宝塔下MySQL启动报错修复

@高效码农  May 12, 2021

原因:

服务器强制重启导致MySQL无法启动报错信息为:

The server quit without updating PID file(XXX/XXX.pid)

查看mysql日志报错信息为:

/www/server/mysql/bin/mysqld: Table './mysql/db' is marked as crashed and should be repaired

Fatal error: Can't open and lock privilege tables: Table './mysql/db' is marked as crashed and should be repaired

修复方法:

5.6版本的数据库为:

myisamchk -rf /www/server/data/mysql/db

其他版本的数据库为:

myisamchk -rf /www/server/data/mysql/db.MYI


添加新评论