解決mysql服務器Cannot allocate memory for the buffer pool

數據庫服務器莫名其妙地掛掉了,而且啟動也啟動不了。

於是

tail -100 /var/log/mysql.log

發現如下錯誤信息

2018-05-12T13:10:04.656521Z 0 [ERROR] InnoDB: mmap(137428992 bytes) failed; errno 12
2018-05-12T13:10:04.656529Z 0 [ERROR] InnoDB: Cannot allocate memory for the buffer pool
2018-05-12T13:10:04.656535Z 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error
2018-05-12T13:10:04.656541Z 0 [ERROR] Plugin 'InnoDB' init function returned error.
2018-05-12T13:10:04.656544Z 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2018-05-12T13:10:04.656547Z 0 [ERROR] Failed to initialize builtin plugins.
2018-05-12T13:10:04.656550Z 0 [ERROR] Aborting

很明顯,是因為服務器內存不足了,innodb啟動不了,所以去/etc/my.cnf

加上這麼一條配置:

innodb_buffer_pool_size=50M

重新啟動,搞定。

本文由ISMY博客發佈


分享到:


相關文章: