MySQL5.7.31编译安装时常见错误分析

1 没有安装MySQL所需要的boost库

测试发现编译MySQL5.7以及更高的版本时,都需要下载并引用或者直接安装boost库,否则在执行cmake命令时会报如下错误:

-- Running cmake version 3.2.1
-- Configuring with MAX_INDEXES = 64U
-- SIZEOF_VOIDP 8
-- MySQL 5.7.6-m16          [MySQL版本]
-- Packaging as: mysql-5.7.6-m16-Linux-x86_64
-- Looked for boost/version.hpp in  and 
-- BOOST_INCLUDE_DIR BOOST_INCLUDE_DIR-NOTFOUND
-- LOCAL_BOOST_DIR 
-- LOCAL_BOOST_ZIP 
-- Could not find (the correct version of) boost.       [关键错误信息]
-- MySQL currently requires boost_1_57_0                    [解决办法]

CMake Error at cmake/boost.cmake:76 (MESSAGE):          [具体错误和解决方法]
  You can download it with -DDOWNLOAD_BOOST=1 -DWITH_BOOST=

  This CMake script will look for boost in .  If it is not there,
  it will download and unpack it (in that directory) for you.

  If you are inside a firewall, you may need to use an http proxy:

  export http_proxy=http://example.com:80

Call Stack (most recent call first):
  cmake/boost.cmake:228 (COULD_NOT_FIND_BOOST)
  CMakeLists.txt:452 (INCLUDE)


-- Configuring incomplete, errors occurred!
See also "/mydata/mysql-5.7.6-m16/CMakeFiles/CMakeOutput.log".

解决方法:先下载Boost库,然后通过在cmake命令后面添加参数-DDOWNLOAD_BOOST=1 -DWITH_BOOST=Boost库路径即可。

mkdir /usr/local/boost
cd /usr/local/boost
wget http://www.sourceforge.net/projects/boost/files/boost/1.59.0/boost_1_59_0.tar.gz
tar zxvf boost_1_59_0.tar.gz

注意:如果在CMAKE的过程中有报错,当报错解决后,需要把源码目录中的CMakeCache.txt文件删除,然后再重新Cmake

参考:Linux 源码编译安装MySQL 5.7

你可能感兴趣的:(Mysql)