代码学堂(uxuew.cn)提供付费解决PHP WEB开发等技术服务,如果需要请 点击加我QQ:1662935793.
>数据库 > MySQL教程 > MySQL错误修复:Table xx is marked as crashed and last (automatic?) repair

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

MySQL教程 围观7315次 更新日期:2017-06-21 23:17:27 留下足迹

数据库坏了,访问网站报错如下:

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/mysql/zhangge_db

然后执行如下命令:

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

启动MySQL:service mysqld start

最后,执行再次自动修复优化命令即可解决:

转载请注明:代码学堂>数据库 > MySQL教程 > MySQL错误修复:Table xx is marked as crashed and last (automatic?) repair

喜欢 (251) or 分享 (347)