脚踏实地、勇往直前!
全部博文(1005)
分类: Mysql/postgreSQL
2017-09-19 18:54:47
1.安装相应的依赖包
yum install -y cmake make gcc gcc-c++ ncurses-devel
2.解压缩安装包(源码tar安装包在官网下载)
tar -zxvf mysql-5.7.19.tar.gz
tar -zxvf mysql-boost-5.7.19.tar.gz
cd mysql-5.7.19 -- 进入到解压目录
mkdir debug -- 创建临时目录
3.cmake(红色标识的目录需要提取创建好)
进入临时目录
cd debug
cmake .. -DCMAKE_INSTALL_PREFIX=/opt/mysql5719_software -DMYSQL_DATADIR=/opt/mysql5719_software/data -DWITH_INNOBASE_STORAGE_ENGINE=1 -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DDOWNLOAD_BOOST=1 -DWITH_BOOST=/opt/mysql5719-source/mysql-5.7.19/boost/boost_1_59_0/
make && make install
第一次报错:
c++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See < for instructions.
make[2]: *** [sql/CMakeFiles/sql.dir/geometry_rtree.cc.o] Error 4
make[1]: *** [sql/CMakeFiles/sql.dir/all] Error 2
make: *** [all] Error 2
网上查了说是因为内存太小问题,后来添加内存后,问题不再出现
第二次报错:
collect2: error: ld returned 1 exit status
make[2]: *** [libmysqld/examples/mysql_client_test_embedded] Error 1
make[1]: *** [libmysqld/examples/CMakeFiles/mysql_client_test_embedded.dir/all] Error 2
make: *** [all] Error 2
添加步骤4红色标识的参数后问题解决.
4.再次编译
cd debug
rm -rf * ##删除掉上次编译的临时文件
##再次编译
cmake .. -DCMAKE_INSTALL_PREFIX=/opt/mysql5719_software -DMYSQL_DATADIR=/opt/mysql5719_software/data -DWITH_INNOBASE_STORAGE_ENGINE=1 -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DDOWNLOAD_BOOST=1 -DWITH_BOOST=/opt/mysql5719-source/mysql-5.7.19/boost/boost_1_59_0/ -DWITH_EMBEDDED_SERVER=OFF
make && make install
-- The End --