1.克隆代码#cd /usr/local/src/#git clone https://GitHub.com/Meituan-Dianping/sqlAdvisor.git2.安装依赖包#yum insta
1.克隆代码
#cd /usr/local/src/
#git clone https://GitHub.com/Meituan-Dianping/sqlAdvisor.git
2.安装依赖包
#yum install -y make cmake libaio-devel libffi-devel glib2 glib2-devel bison GCc gcc-c++
3.编译sqladvisor时依赖perconaserverclient_r, 因此需要安装Percona-Server-shared-56。有可能需要配置软链接例如:
#cd /usr/lib64/
#ln -s libperconaserverclient_r.so.18 libperconaserverclient_r.so
4.安装percona56 yum源及安装:
#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. 编译sqladvisor的依赖项sqlparser(源码目录)
#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.编译sqladvisor(源码目录)
#cd ./sqladvisor/
#cmake -DCMAKE_BUILD_TYPE=debug ./
#make
7.完成测试
#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语句" -v 1
8.简化命令
#vim /etc/sql.cnf
[sqladvisor]
username=xxx
passWord=xxx
host=xxx
port=xxx
dbname=xxx
#sqladvisor -f /etc/sql.cnf -q "sql语句" -v 1
--结束END--
本文标题: centos7下安装sql优化工具SQLAdvisor
本文链接: https://lsjlt.com/news/44208.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
2024-10-23
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0