最近 MySQL 又开始出现崩溃错误,然后就想去研究一下 MySQL 的配置文件 my.cnf。然后就随便改了点参数。然后就特么悲剧了。

MySQL 无法打开了,一直蹦 ERROR! MySQL manager or server PID file could not be found! 的错误。

还是查看日志吧,/usr/local/mysql/var/主机名.err 找到了日志,发现有这么几条错误

1
2
3
4
5
6
InnoDB: Error: log file /usr/local/mysql/var/ib_logfile0 is of different size 0 67108864 bytes
InnoDB: than specified in the .cnf file 0 2097152 bytes!
171114 11:33:08 [ERROR] Plugin 'InnoDB' init function returned error.
171114 11:33:08 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
171114 11:33:08 [ERROR] Unknown/unsupported storage engine: InnoDB
171114 11:33:08 [ERROR] Aborting

网上看了一下,原来是我之前优化 MySQL 配置文件的时候,顺道改了 InnoDB 的设置。然后就出现错误了。吧 Log File 的值改回 64M 。
再重启 MySQL,正常启动了。