阿里云vps上mysql挂掉的解决办法

来源:互联网 发布:区域设置软件中文版 编辑:程序博客网 时间:2024/06/06 02:22
130728  6:50:14 [Note] Plugin 'FEDERATED' is disabled.130728  6:50:14 InnoDB: The InnoDB memory heap is disabled130728  6:50:14 InnoDB: Mutexes and rw_locks use GCC atomic builtins130728  6:50:14 InnoDB: Compressed tables use zlib 1.2.3.4130728  6:50:14 InnoDB: Initializing buffer pool, size = 128.0MInnoDB: mmap(137363456 bytes) failed; errno 12130728  6:50:14 InnoDB: Completed initialization of buffer pool130728  6:50:14 InnoDB: Fatal error: cannot allocate memory for the buffer pool130728  6:50:14 [ERROR] Plugin 'InnoDB' init function returned error.130728  6:50:14 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.130728  6:50:14 [ERROR] Unknown/unsupported storage engine: InnoDB130728  6:50:14 [ERROR] Aborting130728  6:50:14 [Note] /usr/sbin/mysqld: Shutdown complete

解决方法:
1) 在 /etc/mysql/my.cnf 的 mysqld 下增加下面一句:

innodb_buffer_pool_size = 64M

还要设置一下swap分区,因为我的vps是没有swap分区的,通过fdisk -l 和 1mount 看不到swap的信息,需要手动添加一下。

2) 添加swap分区的步骤:

2.1) dd if=/dev/zero of=/swapfile bs=1M count=10242.2) mkswap /swapfile2.3) swapon /swapfile2.4) 添加这行: /swapfile swap swap defaults 0 0 到 /etc/fstab
原创粉丝点击