先看控制台報錯信息:
[ 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緩存。