Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Install sql optimization tool SQLAdvisor under centos7

2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

1. Clone code

# cd / usr/local/src/

# git clone https://github.com/Meituan-Dianping/SQLAdvisor.git

two。 Install dependency packages

# yum install-y make cmake libaio-devel libffi-devel glib2 glib2-devel bison gcc gcc-c++

3. Compiling sqladvisor depends on perconaserverclient_r, so you need to install Percona-Server-shared-56. You may need to configure soft links such as:

# cd / usr/lib64/

# ln-s libperconaserverclient_r.so.18 libperconaserverclient_r.so

4. Install the percona56 yum source and install:

# wget http://www.percona.com/downloads/percona-release/redhat/0.1-3/percona-release-0.1-3.noarch.rpm

# yum install percona-release-0.1-3.noarch.rpm-y

# yum install Percona-Server-shared-56-y

5. Compile sqladvisor's dependency sqlparser (source directory)

# cd / usr/local/src/SQLAdvisor/

# cmake-DBUILD_CONFIG=mysql_release-DCMAKE_BUILD_TYPE=debug-DCMAKE_INSTALL_PREFIX=/usr/local/sqlparser-DIGNORE_AIO_CHECK=/usr/share/doc/libaio-0.3.109. /

# make & & make install

6. Compile sqladvisor (source directory)

# cd. / sqladvisor/

# cmake-DCMAKE_BUILD_TYPE=debug. /

# make

7. Complete the test

# cp / usr/local/src/SQLAdvisor/sqladvisor/sqladvisor / usr/bin/sqladvisor

# sqladvisor-h 127.0.0.1-P 3306-u root-p '123456'-d test-Q "sql statement"-v 1

8. Simplify command

# vim / etc/sql.cnf

[sqladvisor]

Username=xxx

Password=xxx

Host=xxx

Port=xxx

Dbname=xxx

# sqladvisor-f / etc/sql.cnf-Q "sql statement"-v 1

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report