设为首页 加入收藏

TOP

MySQL内存不足启动失败的解决方法
2018-03-18 16:21:26 】 浏览:40
Tags: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. 备注:


生成空文件


dd if=/dev/zero of=1.txt bs=1M count=2 生成一个指定大小的空文件
if=文件名:输入文件名
of=文件名:输出文件名
bs=字节大小
count=个数


】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇Redis主从+KeepAlived实现高可用 下一篇基于函数的索引+创建基于函数的索..

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目