MySQL表损坏修复【Incorrect key file for table】
今天机房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】的更多相关文章
- 数据表损坏:Incorrect key file for table
最近做项目过程中,调用数据库内容,老是出现一些类似于数据表损坏的提示信息(Incorrect key file for table edison_category),查询不到数据,很是恼火,后来冷静下 ...
- MyISAM引擎表出现“Error 'Incorrect key file for table”
mysql主从复制中的从库突然出现了警报,sql_thread停止了,show slave status\G;查看 mysql> show slave status\G ; . row **** ...
- 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" 现 ...
- mysql出现“Incorrect key file for table”解决办法
本文来自: https://www.cnblogs.com/zjoch/archive/2013/08/19/3267131.html 今天mysql突然出现以下错误: mysql> selec ...
- mysql错误(Incorrect key file for table)
Incorrect key file for table 'C:\Windows\TEMP\#sql578_6e2_68d.MYI'; try to repair it mysql错误:mysql需要 ...
- 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 ...
- Incorrect key file for table错误解决方法
问题现象: alter table portal_app_xxxx_xxx add devno varchar(64) NOT NULL DEFAULT '' COMMENT '设备机编',add s ...
- 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 ...
- MySQL 2003 [ERROR] /usr/sbin/mysqld: Incorrect key file for table './keyword_search/keyword.MYI'; try to repair it
今天对一个有四百多万数据的表增加一个功能时,当做数据插入时,显示没有插入,到Linux的log下面查看了发现下面这条错误信息 在stacOver上面找到这句: 存储引擎(MyISAM)支持修复表.你应 ...
随机推荐
- CLR via 笔记4.2 类型转换 is 与 as 区别
is 和 as 操作符是用来进行强制类型转换的 is : 检查一个对象是否兼容于其他指定的类型,并返回一个Bool值,永远不会抛出异常 object o = new object(); if (o i ...
- FW:主流RPC框架
主流RPC框架 2015年10月27日 zman RPC 介绍目前在互联网公司比较流行的开源的RPC框架. RPC框架比较 语言 协议 服务治理 社区 机构 Hessian 多语言 he ...
- Sqoop简介及使用
一.Sqoop概述 1)官网 http://sqoop.apache.org/ 2)场景 传统型缺点,分布式存储.把传统型数据库数据迁移. Apache Sqoop(TM)是一种用于在Apache H ...
- 【react 样式】给react组件指定style
1.使用行内样式(优先级高) 自定义的react组件是没有style属性的,如果要给想给自定义react组件指定style,我的方法是用一个<div>包裹自定义组件,然后给div指定sty ...
- print文档
文档 def print(self, *args, sep=' ', end='\n', file=None): # known special case of print ""& ...
- Elasticsearch.js 发布 —— 在Node.js和浏览器中调用Elasticsearch
继PHP.Ruby.Python和Perl之后,Elasticsearch最近发布了Elasticsearch.js,Elasticsearch的JavaScript客户端库.可以在Node.js和浏 ...
- php实现异步的程序调用
浏览器和服务器之间的通信是基于HTTP协议进行链接通讯的,它是一种请求和相应的协议.浏览器通过URL向服务器发送请求,服务器接收到请求并执行请求,然后服务器将执行完成的数据返回到客户端. 这就存在一个 ...
- CF519 ABCD D. A and B and Interesting Substrings(map,好题)
A:http://codeforces.com/problemset/problem/519/A 水题没什么好说的. #include <iostream> #include <st ...
- django xadmin app models 注册
在app下新建adminx.py文件 # -*- coding: utf-8 -*- # 作者:神秘藏宝室 # 日期:2018/12/28 22:07 import xadmin from .mode ...
- oracle RMAN复制数据库
列出创建副本数据库的目的 • 选择用于复制数据库的方法 • 使用RMAN 复制数据库 • 使用RMAN 备份复制数据库 • 基于正在运行的实例复制数据库 使用副本数据库 • 使用副本数据库可执行以 ...