linux mysql数据库启动失败日志查询,实时诊断分析 异常断电关机导致锁表状态,使用中解锁
tail -f /var/log/mysqld.log | grep error数据库重启命令
service mysqld restart
发现报错
2018-03-03 03:51:57 15709 Fatal error: Can't open and lock privilege tables: Table './mysql/user' is marked as crashed and should be repaired
网上搜索,全尼玛是错的,,什么
myisamchk -c -r /var/lib/mysql/mysql/user.MYI
执行就报错这个
myisamchk: error: 140 when opening MyISAM-table 'user.MYI'
后来,,还是自己看--h帮助列表才找到解决方法,分享下
myisamchk -r /var/lib/mysql/mysql/user
回显
- recovering (with sort) MyISAM-table '/var/lib/mysql/mysql/user'
Data records: 301
- Fixing index 1
然后重启数据库,OK,搞定,,网上全都是瞎KB转载的文章,,全都是错的,,根本不用去操作什么MYI文件
页:
[1]