今天机房mysql服务器异常关机,重新启动后报错如下:

-- ::  [ERROR] /usr/local/mysql/bin/mysqld: Incorrect key file for table './cdb/passport_account.MYI'; try to repair it
-- :: [ERROR] /usr/local/mysql/bin/mysqld: Incorrect key file for table './cdb/passport_account.MYI'; try to repair it
-- :: [ERROR] Got an error from thread_id=, /usr/local/src/mysql-5.x./storage/myisam/mi_update.c:
-- :: [ERROR] MySQL thread id , OS thread handle 0x7ff560e3d700, query id 192.168.5.202 csr updating

修复方法如下:

mysql> repair table passport_account;
+----------------------+--------+----------+----------+
| Table | Op | Msg_type | Msg_text |
+----------------------+--------+----------+----------+
| cdb.passport_account | repair | status | OK |
+----------------------+--------+----------+----------+
1 row in set (3 min 34.72 sec)

恢复正常。

ps:有朋友遇到到执行SQL的时候,产生临时数据占满了/tmp磁盘空间,可以把临时文件选择放在空间大的磁盘目录下面,解决方法如下:

mysql> show variables like 'tmpdir';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| tmpdir | /tmp |
+---------------+-------+
1 row in set (0.00 sec) mysql> set global tmpdir = '/Data/xxx/mysqltmp';
ERROR 1238 (HY000): Variable 'tmpdir' is a read only variable

如果有报错可以配置文件

vim /etc/mysql/my.cnf

此处可以修改 tmpdir 的属性值,也可以修改 query_cache_limit 的数值,建议使用后者

重启MySQL就ok了

MySQL表损坏修复【Incorrect key file for table】的更多相关文章

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

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

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

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

  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”解决办法

    本文来自: https://www.cnblogs.com/zjoch/archive/2013/08/19/3267131.html 今天mysql突然出现以下错误: mysql> selec ...

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

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

  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. Incorrect key file for table错误解决方法

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

  8. 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 ...

  9. MySQL 2003 [ERROR] /usr/sbin/mysqld: Incorrect key file for table './keyword_search/keyword.MYI'; try to repair it

    今天对一个有四百多万数据的表增加一个功能时,当做数据插入时,显示没有插入,到Linux的log下面查看了发现下面这条错误信息 在stacOver上面找到这句: 存储引擎(MyISAM)支持修复表.你应 ...

随机推荐

  1. 解决mysql不能通过'/tmp/mysql.sock 连接的问题

    解决方法:php标准配置正是通过'/tmp/mysql.sock',但一些mysql安装方法将mysql.sock放在/var/lib/mysql.sock或者其他地方,你可以通过修改/etc/my. ...

  2. LayoutInflater的动态增加控件

    在实际开发中LayoutInflater这个类是非常有用的,它的作用类似于 findViewById(),不同点是LayoutInflater是用来找layout下xml布局文件. 而findView ...

  3. celery-rabbitmq 安装部署

    一:Python安装 1.下载python3源码 wget https://www.python.org/ftp/python/3.5.0/Python-3.5.0.tgz 2.解压 tar xf P ...

  4. webpack无法通过 IP 地址访问 localhost 解决方案

    解决方案: 在config里面的index.js里面的module.exports下面的dev下面的host:'localhost' 改为 host:'0.0.0.0',就可以访问啦!

  5. MySQL对指定字段进行加密(双向加密)

    1:建表 test create table test( name varchar(200), value blob ); 插入数据 使用 ENCODE 加密: ,ENCODE('加密字段值', '钥 ...

  6. 基于rman的坏块恢复

    转载请注明出处 http://blog.csdn.net/guoyjoe/article/details/30965303   实验过程例如以下: 1.使用rman备份全库 Recovery Mana ...

  7. mysql应用实例

    目录: 表结构 sql练习 1.表结构 SET NAMES utf8; SET FOREIGN_KEY_CHECKS = 0; -- ---------------------------- -- T ...

  8. TensorFlow学习笔记(三)MNIST数字识别问题

    一.MNSIT数据处理 MNSIT是一个非常有名的手写体数字识别数据集.包含60000张训练图片,10000张测试图片.每张图片是28X28的数字. TonserFlow提供了一个类来处理 MNSIT ...

  9. Oracle trigger 触发器

    触发器使用教程和命名规范 目  录触发器使用教程和命名规范 11,触发器简介 12,触发器示例 23,触发器语法和功能 34,例一:行级触发器之一 45,例二:行级触发器之二 46,例三:INSTEA ...

  10. 关于在MFC的视图类里面添加各种控件 以及给这些控件添加对用的函数。2015-03-24 13:46:00

    首先我们把题目所示的要求分为两个问题: 问题一:如何给基于MFC的单文档视图类里面添加 控件.就是那种类似工具箱里面的控件. 问题二:如何给已经添加的控件 定义一些消息的响应函数. ××××××××× ...