本文摘自PHP中文网,作者coldplay.xixi,侵删。
MySQL内存不足的解决方法:1、增加swap交换空间,代码为【dd if=/dev/zero of=/swapfile bs=1M count=1024】;2、增加自动挂载,在文件【/etc/fstab中加入/swapfileswap】。
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
相关阅读 >>
更多相关阅读请进入《mysql》频道 >>

数据库系统概念 第6版
本书主要讲述了数据模型、基于对象的数据库和XML、数据存储和查询、事务管理、体系结构等方面的内容。