MySQL内存不足的解决方法:
1、启动MySQL时一直不成功,查看错误日志 /var/log/mysql/error.log
2、主要的错误信息有如下几条:
[ERROR] InnoDB: mmap(136151040 bytes) failed; errno 12
[ERROR] InnoDB: Cannot allocate memory for the buffer pool
[ERROR] InnoDB: Plugin initialization aborted with error Generic error
[ERROR] Plugin 'InnoDB' init function returned error.
[ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
[ERROR] Failed to initialize plugins.
[ERROR] Aborting
3、查询后是因为内存不足,查看内存
增加swap交换空间解决问题:
dd if=/dev/zero of=/swapfile bs=1M count=1024
mkswap /swapfile
swapon /swapfile
4、增加自动挂载:
在文件/etc/fstab中加入 /swapfile swap swap defaults 0 0
service mysql start 启动成功
5、备注:
生成空文件
免责声明:本网转载或编译文章原文均来自网络,不代表本网观点或证实其内容的真实性。若有来源标注错误或涉及文章版权问题,请与本网联系,本网将及时更正、删除,谢谢。如需转载时请以链接形式注明文章出处:http://www.jywlcm.com/353.html
微信联系