Always been imitated
Never surpassed

MySQL错误修复:Table xx is marked as crashed and last (automatic?) repair failed

偶尔遇到网站访问报错如下:

Error establishing a database connection

MySQL 的错误日志,报错如下:

Error: Table ‘./db_name/table_name’ is marked as crashed and last (automatic?) repair failed

修复很简单,先停止 MySQL:service mysqld stop

进入到 MySQL 数据库的文件存放目录,比如 cd /data/zh_db

然后执行如下命令:myisamchk –safe-recover -f -r *.MYI

1myisamchk –safe-recover -f -r *.MYI

执行完成后,为了保险起见,我们要将文件的权限改回 MySQL 的运行账号(自行查看),比如 mysql:chown -R mysql:mysql .

1chown -R mysql:mysql .

启动 MySQL:service mysqld start

最后,执行再次自动修复优化命令即可解决:mysqlcheck –auto-repair –optimize –all-databases -p密码

1mysqlcheck –auto-repair –optimize –all-databases -p密码
赞(0)
@请尊重原创,未经允许不得转载:军S小站 » MySQL错误修复:Table xx is marked as crashed and last (automatic?) repair failed

智慧源于勤奋,伟大出自平凡

联系我们

© 2019 军S小站   ©备案号: 蜀ICP备17043886号-2    网站地图   友情链接