Heim >Datenbank >MySQL-Tutorial >MySQL无法启动cannot allocate the memory for the buffer pool

MySQL无法启动cannot allocate the memory for the buffer pool

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-07 16:43:331574Durchsuche

MySQL无法启动mdash;mdash;cannot allocate the memory for the buffer pool

今天打开开发网站突然不能使用,发现时MySQL数据库down掉了,就去重启:

 mysql.server  restart

一直会报错:“Manager of pid-file quit without updating file”。

然后就去找原因,网上说有以下三个方面的问题:

1、硬盘不够用了,,无法写入pid文件

2、进程卡死了,找到mysql进程kill掉,然后重启

3、目录权限问题,找到pid文件写入的目录,查看目录权限是否是使用的安装mysql指定的用户

上述是关于这个问题的最多的解决方案,但是我试了一下都没效果。于是我去查看了mysql.err错误日志文件:

tail -100 mysql.err

发现了下图所示的错误:

MySQL无法启动——cannot allocate the memory for the buff

直接可以看出是因为内存不足了,因此mysql无法启动的真正原因其实是:

cannot allocate the memory for the buffer pool

然后就去检查了一下内存:

free -ml

发现确实不足,只剩下300多M了,因此首先kill掉了机器上其他的一些无用的进程,接着去修改了my.cnf配置文件,找到了如下两个字段分别将前者由2G改为200M,后者改为了120M。

innodb_buffer_pool_size=200M
key_buffer=120M

然后在重启MySQL后就可以了。

--------------------------------------分割线 --------------------------------------

Ubuntu 14.04下安装MySQL

《MySQL权威指南(原书第2版)》清晰中文扫描版 PDF

Ubuntu 14.04 LTS 安装 LNMP Nginx\PHP5 (PHP-FPM)\MySQL

Ubuntu 14.04下搭建MySQL主从服务器

Ubuntu 12.04 LTS 构建高可用分布式 MySQL 集群

Ubuntu 12.04下源代码安装MySQL5.6以及Python-MySQLdb

MySQL-5.5.38通用二进制安装

--------------------------------------分割线 --------------------------------------

本文永久更新链接地址:

linux

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn