mysql编译报错

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.

在网上搜了一下,说是由于编译mysql时,系统内存不够导致的,解决方法:

1、尽量空出多一点的内存给mysql编译使用,杀掉占内存又不必要的进程

2、临时使用交换分区来解决

  sudo dd if=/dev/zero of=/swapfile bs=64M count=16
  sudo mkswap /swapfile   #mkswap 命令来设置交换分区

  chmod 0600 /swapfile    #该目录权限,不改的话,在下一步启动时会报“swapon: /swapfile: insecure permissions 0644, 0600 suggested.”错误
  sudo swapon /swapfile     #swapon启用交换分区

  然后正常执行编译过程,完成之后,可以关闭交换空间:swapoff 设备或文件,也可以 swapoff -a(整个过程操作之后,可以将/swapfile删掉,免得占磁盘空间)

原文地址:https://www.cnblogs.com/Christine-ting/p/10518499.html