在低内存虚拟机上启动MySQL

在内存很小的主机上运行mysql,经常出现mysql应用崩溃的情况。查看日志提示:

160608 12:08:05 InnoDB: Completed initialization of buffer pool
160608 12:08:05 InnoDB: Fatal error: cannot allocate memory for the buffer pool
160608 12:08:05 [ERROR] Plugin ‘InnoDB’ init function returned error.
160608 12:08:05 [ERROR] Plugin ‘InnoDB’ registration as a STORAGE ENGINE failed.
160608 12:08:05 [ERROR] mysqld: Out of memory (Needed 128917504 bytes)

查找资料需要禁用性能优化模式

编辑my.cnf文件

vim /etc/my.cnf

[mysqld]  中添加一行:

performance_schema = off

保存、重启应用。

发表评论

电子邮件地址不会被公开。 必填项已用*标注