Centos7安装美团SQL优化工具SQLAdvisor

时间:2022-07-25 03:43:42

1 下载源码

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

2 安装依赖环境

yum  install cmake libaio-devel libffi-devel glib2 glib2-devel  bison gcc gcc-c++
yum  install http://www.percona.com/downloads/percona-release/redhat/0.1-3/percona-release-0.1-3.noarch.rpm
yum  install -y Percona-Server-shared-56

3 依赖libperconaserverclient_r

cd /usr/lib64/
ln -s libperconaserverclient_r.so.18 libperconaserverclient_r.so

4 编译源码sqladvisor的依赖

cd SQLAdvisor/
cmake -DBUILD_CONFIG=mysql_release -DCMAKE_BUILD_TYPE=debug -DCMAKE_INSTALL_PREFIX=/usr/local/sqlparser ./
make && make install

5 编译sqladvisor

cd SQLAdvisor/sqladvisor/
cmake -DCMAKE_BUILD_TYPE=debug ./
make

6 测试安装效果

./sqladvisor --help

Centos7安装美团SQL优化工具SQLAdvisor

使用说明详见GitHub地址

  

https://github.com/Meituan-Dianping/SQLAdvisor