MySQL在5.7版本及以后,都需要boots 库,所以需要先安装boots

步骤:

1.在/usr/local下创建 名为boots的目录

mkdir -p /usr/local/boots

2.进入该目录,然后下载boots

wget http://www.sourceforge.net/projects/boost/files/boost/1.59.0/boost_1_59_0.tar.gz

3.解压

tar xf boost_1_59_0.tar.gz

4.继续cmake,但在cmake内添加如下红色部分

cmake . \
-DCMAKE_INSTALL_PREFIX=/mydb/mysql31 \
-DMYSQL_DATADIR=/mydb/mysql31/data \
-DSYSCONFDIR=/etc \
-DMYSQL_TCP_PORT=3308 \
-DMYSQL_UNIX_ADDR=/mydb/mysql31/mysql31.sock \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWITH_PARTITION_STORAGE_ENGINE=1 \
-DWITH_FEDERATED_STORAGE_ENGINE=1 \
-DWITH_BLACKHOLE_STORAGE_ENGINE=1 \
-DWITH_MYISAM_STORAGE_ENGINE=1 \
-DENABLED_LOCAL_INFILE=1 \

-DWITH_BOOST=/usr/local/boost \
-DEXTRA_CHARSETS=all \
-DDEFAULT_CHARSET=utf8mb4 \
-DDEFAULT_COLLATION=utf8mb4_general_ci

完事儿继续cmake即可

04-25 20:21