今天早上访问网页,提示错误,数据库连接不上,然后重启mysql服务,提示
MySQL manager or server PID file could not be found!
Starting MySQL.Manager of pid-file quit without updating fi
好郁闷,然后查看了错误日志 ,里面有这样的提示:
150814 12:04:09 [ERROR] /usr/local/mysql/bin/mysqld: Table ‘./mysql/user‘ is marked as crashed and last (automatic?) repair failed
150814 12:04:09 [ERROR] Fatal error: Can‘t open and lock privilege tables: Table ‘./mysql/user‘ is marked as crashed and last (automatic?) repair failed
只能看懂少部分,说我这个user表好像修复失败,从来没有遇到过这个错误,于是上午查资料,试了好几个都不成功,最后偶然看到了一篇文章:
1 进入你数据库的安装路径我的是/data/mysql/mysql
2 运行myisamchk -of user.MYI 修复我的user表 出现下面的提示代表成功:
- recovering (with keycache) MyISAM-table ‘user.MYI‘
Data records: 6
3 再次重启mysql服务,成功。
参考文章:http://www.jb51.net/article/33627.htm
时间: 2024-10-13 09:51:21