今天使用xampp的时候,mysql关闭之后突然无法启动,报错为:
15:30:15 [mysql] Error: MySQL shutdown unexpectedly.
15:30:15 [mysql] This may be due to a blocked port, missing dependencies,
15:30:15 [mysql] improper privileges, a crash, or a shutdown by another method.
15:30:15 [mysql] Press the Logs button to view error logs and check
15:30:15 [mysql] the Windows Event Viewer for more clues
15:30:15 [mysql] If you need more help, copy and post this
15:30:15 [mysql] entire log window on the forums
上网搜了一下,都说要把xampp\mysql\data下的ibdata1文件删掉,于是我也乐呵乐呵地把ibdata1删了。
删了之后果然启动成功,可是进myadmin一看......数据表全不见。并且以后每次启动mysql都要做这样的删除操作。
果断上网再查,发现一个一劳永逸又不影响数据的方法:
在mysql/bin/my.ini 文件 加一个:
[mysqld]
innodb_force_recovery = 4
这样就OK了。