From 8e815a69a2226dbeca4b3d8c6ef8509a66e54dfe Mon Sep 17 00:00:00 2001 From: ppabc Date: Wed, 11 Apr 2018 10:58:45 +0800 Subject: [PATCH] SQLAdvisor --- shell/sqladvisor.sh | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 shell/sqladvisor.sh diff --git a/shell/sqladvisor.sh b/shell/sqladvisor.sh new file mode 100644 index 0000000..91cb0d4 --- /dev/null +++ b/shell/sqladvisor.sh @@ -0,0 +1,27 @@ +#!/bin/bash +## shell常用命令 2018-04-10 +## http://www.aqzt.com +## email: ppabc@qq.com +## robert yu +## Centos6下一键安装美团开源SQL优化工具SQLAdvisor脚本 + +yum install -y http://www.percona.com/downloads/percona-release/redhat/0.1-4/percona-release-0.1-4.noarch.rpm +yum install -y gcc-c++ make gcc httpd php mysql php-mysql php-devel php-pear libssh2 libssh2-devel unzip cmake libaio-devel libffi-devel glib2 glib2-devel Percona-Server-shared-56 bison libaio-devel ncurses-devel + +echo '' | pecl install -f ssh2 +ln -s /usr/lib64/libperconaserverclient_r.so.18 /usr/lib64/libperconaserverclient_r.so + +unzip SQLAdvisor.zip +cd SQLAdvisor-master +if [ -f CMakeCache.txt ];then + echo ${line} +fi +rm -rf CMakeCache.txt +cmake -DBUILD_CONFIG=mysql_release -DCMAKE_BUILD_TYPE=debug -DCMAKE_INSTALL_PREFIX=/usr/local/sqlparser ./ +make && make install + +cd sqladvisor +cmake -DCMAKE_BUILD_TYPE=debug ./ +make +cp sqladvisor /usr/bin/sqladvisor +sqladvisor --help \ No newline at end of file