MySQL5.7.17源码编译安装时的注意事项

本文详细介绍了MySQL5.7.17版本在安装过程中如何正确配置Boost库以避免编译错误,包括Boost的下载、解压、编译安装及MySQL编译时指定Boost路径的具体步骤。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

MySQL5.7.17安装略不同于MySQL5.6,需要指定boost,否则编译安装会报错
boost下载地址:
下载:
#wget http://downloads.sourceforge.net/project/boost/boost/1.59.0/boost_1_59_0.tar.gz

解压:
# cd /root
#tar xvzf boost_1_59_0.tar.gz

进入boost_1_59_0目录:
#cd /root/boost_1_59_0

然后是编译安装,直接执行bootstrap.sh就可以:

#sh ./bootstrap.sh

Building Boost.Build engine with toolset gcc... tools/build/v2/engine/bin.linuxx86_64/b2
Detecting Python version... 2.6
Detecting Python root... /usr
Unicode/ICU support for Boost.Regex?... not found.
Generating Boost.Build configuration in project-config.jam...

Bootstrapping is done. To build, run:

    ./b2
    
To adjust configuration, edit ‘project-config.jam‘.
Further information:

   - Command line help:
     ./b2 --help
     
   - Getting started guide: 
     http://www.boost.org/more/getting_started/unix-variants.html
     
   - Boost.Build documentation:
     http://www.boost.org/boost-build2/doc/html/index.html


接下来就是编译,重点关注是否编译成功:
#./b2

然后就是漫长的等待,直到最后出现:


The Boost C++ Libraries were successfully built!


The following directory should be added to compiler include paths:


    /root/boost_1_59_0


The following directory should be added to linker library paths:


    /root/boost_1_59_0/stage/lib


说明编译成功。


最后执行:
./b2 install --prefix=/usr/local


接下来就可以编译MySQL5.7了,需要用-DWITH_BOOST=/root/boost_1_59_0指定boost的目录:
#cmake .  -DCMAKE_INSTALL_PREFIX=/opt/mysql -DWITH_DEBUG=1 -DDOWNLOAD_BOOST=1 -DWITH_BOOST=/root/boost_1_59_0

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/15498/viewspace-2135773/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/15498/viewspace-2135773/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值