本文来自:

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. var entsMapLocation = {……}函数

    var entsMapLocation = { global: { $popupCityBox: $(".ents-map-location-popup-box"), isPosi ...

  2. 64 位 Windows 平台开发注意要点之文件系统重定向

    Program Files 的重定向 很多开发人员都知道,在 64 位 Windows 系统上,32 位程序是无法获取得到 C:\Program Files 的完整路径的,只能获取到 C:\Progr ...

  3. NLP一些工程应用模型

    发现一个DL的博客,对文章分类归纳做的比较好:第三篇文章中的模型可以重点参考 “自然语言学习资料的汇总” 综述 | 一文读懂自然语言处理NLP(附学习资料) 用深度学习(CNN RNN Attenti ...

  4. 盒子尺寸父子传递及嵌套Demo

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...

  5. vb程序安装时需要在客户端安装MSSOAP30.dll,但注册不上,请问怎么处理

    現在想打包发布,在客戶沒有這個控件時,注冊一下,主要是不想在客户机器上安装SoapToolkit30.EXE文件 ?? 推荐解决方案 如果使用 InstallShield 工具来打包,安装完MSSOA ...

  6. shell编程变量介绍与表达式详解

    shell变量简介 变量是任何一种编程语言都必不可少的组成部分,变量用来存放各种数据.脚本语言在定义变量时通常不需要指明类型,直接赋值就可以,Shell 变量也遵循这个规则. 在 Bash shell ...

  7. JS 实现右下角弹窗

    <!DOCTYPE HTML> <head> <title>JS实现右下角弹窗</title> <meta http-equiv="co ...

  8. 配置samba的流程

    1.关闭防火墙和selinuxservice iptables stopsetenforce 02.配置本地yummount /dev/cdrom /mediacd /etc/yum.repos.dc ...

  9. 使用gitblit搭建git服务器

    前言 一直在学习新技术,我想都整理到博客上.公司还在坚持用svn,之前学过git都快要忘记了,此篇博客记录搭建基于gitblit的git服务器.当然直接使用linux也可以,不过我不是很熟悉,考虑到我 ...

  10. mysql 聚集函数 count 使用详解(转载)

    本文将探讨以下问题 1.count(*) . count(n).count(null)与count(fieldName)2.distinct 与 count 连用3.group by (多个字段) 与 ...