Home >Database >Mysql Tutorial >数据库表损坏的修复

数据库表损坏的修复

WBOY
WBOYOriginal
2016-06-07 15:16:151321browse

网站访问mysql出现错误: load() - DBD::mysql::st execute failed: Table './test/test_user' is marked as crashed and last (automatic?) repair failed at /usr/local/share/perl/5.10.0/Rose/DB/Object.pm line 385. 用命令行访问出现: ERROR 145 (HY0

网站访问mysql出现错误:

用命令行访问出现:

开始时使用myisamchk -r -o  /home/test/test_user.MYI进行修复,出现错误:myisamchk: error: myisam_sort_buffer_size is too small。

df发现是mysql temp目录太小,此表太大。更改my.cnf文件修改temp路径到空间足够的文件夹。

再次执行 myisamchk -r -o  /home/test/test_user.MYI,显示错误:

不得已,强制执行:myisamchk -r -o -f /home/test/test_user.MYI
这次myisamchk一条条记录检查并修复,几百万条记录用了几个小时,最后这个表终于修复了。

Statement:
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