mysql/user is marked as crashed
准备启动mysql时发现出错了。
MySQL manager or server PID file could not be found! [FAILED]
Starting MySQL…………………………….. [FAILED]
以为是selinux的问题,于是setenforce 0 之后再启动,发现还是出错。
查询 /var/lib/mysql/hostname.err 提示如下:
070130 17:59:41 mysqld started
070130 17:59:42 [ERROR] /usr/sbin/mysqld: Table ‘./mysql/user’ is marked as crashed and should be repaired
070130 17:59:42 [ERROR] /usr/sbin/mysqld: Table ‘./mysql/user’ is marked as crashed and should be repaired
070130 17:59:42 [ERROR] Fatal error: Can’t open and lock privilege tables: Table ‘./mysql/user’ is marked as crashed and should be repaired
070130 17:59:42 mysqld ended
搜索后发现可以通过 以下办法解决:
先加上启动参数
service mysql start –skip-grant-tables
Starting MySQL [ OK ]
启动成功后
就可以进行修复 mysql/user 表了,
root@iplaylinux [/var/lib/mysql/mysql]# mysqlcheck -r mysql user
mysql.user
warning : Number of rows changed from 1558 to 1556
status : OK
修复完毕,重启mysql
root@iplaylinux [/var/lib/mysql/mysql]# service mysql restart
Shutting down MySQLs [ OK ]
Starting MySQL [ OK ]
本文固定链接: https://iplaylinux.com/mysqluser-is-marked-as-crashed.html | Linux玩家