数据库服务器莫名其妙地挂掉了,而且启动也启动不了。
于是
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博客发布
閱讀更多 最後一個NPE 的文章