先看控制台报错信息:
[ 73%] Building CXX object sql/CMakeFiles/sql.dir/item_func.cc.o [ 73%] Building CXX object sql/CMakeFiles/sql.dir/item_geofunc.cc.o c++: internal compiler error: Killed (program cc1plus) Please submit a full bug report, with preprocessed source if appropriate. See <http://bugzilla.redhat.com/bugzilla> for instructions. make[2]: *** [sql/CMakeFiles/sql.dir/item_geofunc.cc.o] Error 4 make[1]: *** [sql/CMakeFiles/sql.dir/all] Error 2 make: *** [all] Error 2
编译了半天, 还报错了, 怎么处理? 原因是MySQL 5.7和MySQL 8.0编译的时候会占用超大的内存引起的编译错误。
解决方法:
请增大服务器内存, 或者干脆用swap解决。
有些自动安装脚本会自行创建swap帮你解决这个问题。自己编译的时候就需要手动敲命令添加swap缓存。