Meituan-Dianping / SQLAdvisor

输入SQL,输出索引优化建议
GNU General Public License v2.0
5.58k stars 1.25k forks source link

Ubuntu 18.04.5 LTS 安装步骤 #90

Open michael-liumh opened 3 years ago

michael-liumh commented 3 years ago

完整的安装步骤:

安装依赖

apt-get install -y gcc g++ cmake make libaio1 libaio-dev libffi-dev libglib2.0-0 libglib2.0-dev

安装 libperconaserverclient18.1-dev

apt-get install -y gnupg2 && \
wget https://repo.percona.com/apt/percona-release_latest.$(lsb_release -sc)_all.deb && \
dpkg -i percona-release_latest.$(lsb_release -sc)_all.deb && \
rm -f percona-release_latest.$(lsb_release -sc)_all.deb && \
apt-get update && \
apt-get install -y libperconaserverclient18.1-dev

编译

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 ./

添加 glibconfig.h 软连接

ln -sf /usr/lib/x86_64-linux-gnu/glib-2.0/include/glibconfig.h /usr/local/sqlparser/include/glibconfig.h

继续安装

make && \
mv /opt/SQLAdvisor/sqladvisor/sqladvisor /bin && \
rm -rf /opt/SQLAdvisor/
ryzencool commented 2 years ago

请问答主安装成功了嘛 我遇到cannot find -lperconaserverclient_r 这个错误 不知道怎么解决

michael-liumh commented 2 years ago

成功了的

abaowhy commented 3 months ago

按照上面的文档,依然安装不成功,只需要对官方的步骤做下修改即可。 改动部分:

  1. yum | apt-get install --enablerepo=Percona56 Percona-Server-shared-56 调整为:
  2. wget https://www.percona.com/downloads/Percona-Server-5.6/Percona-Server-5.6.25-73.1/binary/debian/jessie/x86_64/Percona-Server-5.6.25-73.1-r07b797f-jessie-x86_64-bundle.tar
  3. tar xvf Percona-Server-5.6.25-73.1-r07b797f-jessie-x86_64-bundle.tar
  4. dpkg -i libperconaserverclient18.1-dev_5.6.25-73.1-1.jessie_amd64.deb libperconaserverclient18.1_5.6.25-73.1-1.jessie_amd64.deb percona-server-common-5.6_5.6.25-73.1-1.jessie_amd64.deb