Home > Database > Mysql Tutorial > body text

mysql table is marked as crashed and last (automatic?) repai_MySQL

WBOY
Release: 2016-06-01 13:32:17
Original
1108 people have browsed it

bitsCN.com

mysql table is marked as crashed and last (automatic?) repair failed解决

 

1.同事的服务器在mysqldump备份的时候报错了

 

这个原因是myisam的表数据太多,在某个时刻, 存放数据的这个MyISAM表数据急速长大. 比如一些log表, 当硬盘写满了.这个时候还在继续写.然后这个表就会lock掉;

 

或者是mysiam的存储表的文件tbl_name.MYI 损坏了

 

表现在你用phpmyadmin打开这个数据库的时候. 该MyISAM表的下面几个字段显示in use.

 

Rows Type Collation Sizein use
Copy after login

使用mysqldump导出,报错XXX table is marked as crashed and last (automatic?) repair failed.

2. 解决办法.

找到mysql的数据库存放的文件夹,这个可以去mysql的配置文件 my.cnf (linux) my.ini(windows)里面找datadir 关键字,后面的就是路径

找到对应的数据库文件夹,进去后.在该数据库文件夹下执行, 是你想要修复的表名,

#myisamchk -r <table_name>
Copy after login

如果这样还是不能解决, 停掉mysql,然后

#myisamchk -r -v -f <table_name>
Copy after login

 


bitsCN.com
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template