mysql启动报错cannot allocate memory for the buffer pool处理

时间:2024-04-10 16:06:52

今天启动mysql服务器时失败了。去/var/log/mysql/查看error.log,报错信息如下:

160123 22:29:26 InnoDB: Initializing buffer pool, size = 200.0M

InnoDB: mmap(214630400 bytes) failed; errno 12
160123 22:29:26 InnoDB: Completed initialization of buffer pool

160123 22:29:26 InnoDB: Fatal error: cannot allocate memory for the buffer pool

原来是无法给innodb分配足够的内存,

我的阿里云服务器是最低配的,总共就500M内存,于是到/etc/mysql/my.cnf中改了如下选项:

innodb_buffer_pool_size=50M

再重新运行/etc/init.d/mysql start就成功了。

看来需要好好学习一下mysqll