今天在启动mysql时发现起不来。看了一下错误日志出现下面的错误
2017-12-12T04:51:40.520696Z 0 [ERROR] InnoDB: mmap(137428992 bytes) failed; errno 12 2017-12-12T04:51:40.520703Z 0 [ERROR] InnoDB: Cannot allocate memory for the buffer pool 2017-12-12T04:51:40.520708Z 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error 2017-12-12T04:51:40.520714Z 0 [ERROR] Plugin 'InnoDB' init function returned error. 2017-12-12T04:51:40.520717Z 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed. 2017-12-12T04:51:40.520721Z 0 [ERROR] Failed to initialize plugins. 2017-12-12T04:51:40.520723Z 0 [ERROR] Aborting 2017-12-12T04:51:40.520739Z 0 [Note] Binlog end 2017-12-12T04:51:40.520779Z 0 [Note] Shutting down plugin 'CSV' 2017-12-12T04:51:40.520942Z 0 [Note] /usr/sbin/mysqld: Shutdown complete
出现这些提示说明内存不足。mysql的innodb缓冲池默认是128m的如果你的服务器内存小的话。可以在[mysqld]里面修改一下他的大小
innodb_buffer_pool_size=64MB
然后重启一下mysqld就好了。
版权声明:本文为博主原创文章,未经博主允许不得转载。