刚才在测试源码的时候,宝塔面板看到数据库停止了,无法启动,报Plugin InnoDB init function returned error错误,网上找了几个方法都没有解决。
错误如下:
2020-02-25T13:48:46.098796Z 0 [ERROR] InnoDB: mmap(137428992 bytes) failed; errno 12
2020-02-25T13:48:46.098805Z 0 [ERROR] InnoDB: Cannot allocate memory for the buffer pool
2020-02-25T13:48:46.098812Z 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error
2020-02-25T13:48:46.098823Z 0 [ERROR] Plugin ‘InnoDB’ init function returned error.
2020-02-25T13:48:46.098827Z 0 [ERROR] Plugin ‘InnoDB’ registration as a STORAGE ENGINE failed.
2020-02-25T13:48:46.098832Z 0 [ERROR] Failed to initialize builtin plugins.
2020-02-25T13:48:46.098836Z 0 [ERROR] Aborting
2020-02-25T13:48:46.098848Z 0 [Note] Binlog end
2020-02-25T13:48:46.098907Z 0 [Note] Shutting down plugin ‘CSV’
2020-02-25T13:48:46.099541Z 0 [Note] / www / server / mysql / bin /mysqld: Shutdown complete
关于MySQL Plugin ‘InnoDB’ init function returned error的问题,网上说是只要删除MySQL目录下的ib_logfile0和ib_logfile1和ibdata1就可以了,但是,我去mysql目录没看到这几个文件,然后我感觉是内存不足的问题,我在宝塔数据库设置里的性能调整这里,把内存优化方案改成1-2G的配置,保存后重启就启动了。
做个记录,万一以后碰到也能用上。