本文来自:

https://www.cnblogs.com/zjoch/archive/2013/08/19/3267131.html

今天mysql突然出现以下错误:

mysql> select * from test;
 ERROR 1034 (HY000): Incorrect key file for table ‘test’; try to repair it

首先通过repair table修复:

mysql> repair table test;
 +—————+——–+———-+———————————————————+
 | Table         | Op     | Msg_type | Msg_text                                                |
 +—————+——–+———-+———————————————————+
 | test.test | repair | Error    | Incorrect key file for table ‘test’; try to repair it |
 | test.test | repair | error    | Corrupt 
 
如果还是没用,运行下面命令

mysql> repair table test USE_FRM;
 +—————+——–+———-+———————————————————+
 | Table         | Op     | Msg_type | Msg_text                                                |
 +—————+——–+———-+———————————————————+
 | test.test | repair | Error    |Number of rows changed from 0 to 110423 |
 | test.test | repair | status   | OK

按理应该可以了。
如果还是没用,则退出mysql,执行如下修复动作:

myisamchk -of /var/lib/mysql/test/test.MYI
 myisamchk -r /var/lib/mysql/test/test.MYI
 myisamchk safe-recover /var/lib/mysql/test/test.MYI

再重启mysql后应该可以正常了。

mysql出现“Incorrect key file for table”解决办法的更多相关文章

  1. Incorrect key file for table错误解决方法

    问题现象: alter table portal_app_xxxx_xxx add devno varchar(64) NOT NULL DEFAULT '' COMMENT '设备机编',add s ...

  2. MySQL表损坏修复【Incorrect key file for table】

    今天机房mysql服务器异常关机,重新启动后报错如下: -- :: [ERROR] /usr/local/mysql/bin/mysqld: Incorrect key file for table ...

  3. mysql中大数据表alter增加字段报错:"1034 Incorrect key file for table 'table_name'; try to repair it"

    mysql中大数据表alter增加字段报错:"1034 Incorrect key file for table 'table_name'; try to repair it" 现 ...

  4. mysql错误(Incorrect key file for table)

    Incorrect key file for table 'C:\Windows\TEMP\#sql578_6e2_68d.MYI'; try to repair it mysql错误:mysql需要 ...

  5. java.sql.SQLException: Incorrect key file for table 'C:\Windows\TEMP\#sql578_6e2_68d.MYI'; try to repair it

    java.sql.SQLException: Incorrect key file for table 'C:\Windows\TEMP\#sql578_6e2_68d.MYI'; try to re ...

  6. mysqld: Incorrect key file for table

    错误 140624 0:53:42 [ERROR] /usr/libexec/mysqld: Incorrect key file for table './xx/xxx.MYI'; try to r ...

  7. MyISAM引擎表出现“Error 'Incorrect key file for table”

    mysql主从复制中的从库突然出现了警报,sql_thread停止了,show slave status\G;查看 mysql> show slave status\G ; . row **** ...

  8. 数据表损坏:Incorrect key file for table

    最近做项目过程中,调用数据库内容,老是出现一些类似于数据表损坏的提示信息(Incorrect key file for table edison_category),查询不到数据,很是恼火,后来冷静下 ...

  9. 执行查询报: Incorrect key file for table ‘test’; try to repair it

    报错信息如下:程序没有错误,但执行会报错,错误定在执行语句上 查了一下资料 网上的解决办法,亲试可用: mysql> use news;Database changedmysql> rep ...

随机推荐

  1. RAMOS (内存操作系统)-无忧百科(不断完善中)

    RAMOS (内存操作系统)-无忧百科(不断完善中) - RAMOS - 无忧启动论坛 - Powered by Discuz! http://bbs.wuyou.net/forum.php?mod= ...

  2. URLConnection(互联网)

    一.urlconnection连接Servlet 1:> URL请求的类别:           分为二类,GET与POST请求.二者的区别在于:                         ...

  3. c# 简单方便的连接oracle方式

    通过nuget安装ManagedDataAccess (自动生成的config里面的配置都可以删掉) winform程序,拖出一个datagridview和button using Oracle.Ma ...

  4. 7.4 electirc.c -- 计算电费

    // 7.4 electirc.c -- 计算电费 #include <stdio.h> #define RATE1 0.13230 // 首次使用 360 kwh 的费率 #define ...

  5. 借助ssh隧道和中间主机,使本地主机可以直连远程主机

    本地主机:    localhost 中间主机:   kickstart服务器 10.164.229.162 远程主机:   fuel 服务器  192.168.0.11 背景:正常情况下,本地不能直 ...

  6. 3阶马尔可夫链 自然语言处理python

    一.简介:       把每三个三个单词作为一个整体进行训练. 举一个例子: input:       my dream is that I can be an engineer, so I desi ...

  7. react-redux笔记

    用vuex来对比来说明 分类 vuex redux react-redux 写state commit mutation (mutable state) dispatch reducer (immut ...

  8. Ollydbg中的内存断点和硬件断点的区别

    转载自: https://www.zhihu.com/question/52625624 旅人的回复 作者:旅人链接:https://www.zhihu.com/question/52625624/a ...

  9. Resharper快捷键汇总

    编辑Ctrl + Space 代码完成 Ctrl + Shift + Space代码完成Ctrl + Alt + Space代码完成Ctrl + P 显示参数信息Alt + Insert 生成构造函数 ...

  10. KeyPress和KeyDown/KeyUp

    (1) KeyPress 和KeyDown .KeyUp之间的区别:    1).KeyPress主要用来捕获数字(注意:包括Shift+数字的符号).字母(注意:包括大小写).小键盘等除了F1-12 ...