参考:
https://itbilu.com/database/mysql/VJVOut01M.html
https://blog.csdn.net/Cryhelyxx/article/details/47610247
在安装MySql的时候,必要的依赖必须安装好.
我在安装的时候,boost用的最新版本,然后一直提示我不行
报错
CMake Error at cmake/boost.cmake:76 (MESSAGE): You can download it with -DDOWNLOAD_BOOST=1 -DWITH_BOOST=<directory>
然后Google一下,说必须用1.59.0版本
然后下载之后解压.
cmake . -DWITH_BOOST=/home/www/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 <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
Google一下.
说是内存不足导致
那么设置2G交换分区来用下 :
dd if=/dev/zero of=/swapfile bs=1k count=2048000 --获取要增加的2G的SWAP文件块
mkswap /swapfile -- 创建SWAP文件
swapon /swapfile -- 激活SWAP文件
swapon -s -- 查看SWAP信息是否正确
echo "/var/swapfile swap swap defaults 0 0" >> /etc/fstab -- 添加到fstab文件中让系统引导时自动启动
注意, swapfile文件的路径在/var/下
编译完后, 如果不想要交换分区了, 可以删除:
swapoff /swapfile
rm -fr /swapfile
这里我直接将mysql文件夹删除了.重新解压 重新cmake然后make , make install
启动的时候又报错了!
ERROR! The server quit without updating PID file (/usr/local/mysql/VM_0_11_centos.pid).
猝…不知道哪出错.有时间再弄