Heim  >  Artikel  >  Datenbank  >  mysql table is marked as crashed and last (automatic?) repai_MySQL

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

WBOY
WBOYOriginal
2016-06-01 13:32:171080Durchsuche

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

 

使用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>

 

 

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

 

#myisamchk -r -v -f <table_name>

 


bitsCN.com
Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn