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)支持修复表.你应 ...
随机推荐
- CentOS7部署Haproxy 1.7.2
一.环境准备 1.操作系统 CentOS-7-x86_64-1611 2.Haproxy版本1.7.2 3.Haproxy服务器IP 192.168.186.131.web1服务器安装并启动Nginx ...
- c#系统中类的方法 Console、Object,ToolStripDropDownItem,string
一.Console 1.System 命名空间中的 Console 类提供了一个函数 ReadLine(),用于接收来自用户的输入,并把它存储到一个变量中. int num; num = Conver ...
- 算法大神之路——排序
从今天开始,给自己立下一个目标,每天晚上写一篇算法与数据结构的博客,用来给自己以后的算法工程师的目标铺路! 今天晚上就以算法里面的排序,作为自己的第一章节吧. 排序,就是讲一组数据,按照特定的规则去调 ...
- Random/Stochastic
---恢复内容开始--- ===================================================== A random variable's possible valu ...
- GraphicsMagick 1.3.25 Linux安装部署
1.安装相关依赖包 yum install -y gcc libpng libjpeg libpng-devel libjpeg-devel ghostscript libtiff libtiff-d ...
- 关于Android项目隐藏标题栏的方法总结
1.在代码中添加这么一行代码 this.requestWindowFeature(Window.FEATURE_NO_TITLE); 注意:这段代码需要写在setContentView()之前,否则会 ...
- CMDB实现的四种方式
第一种(agent): 这种方式是通过向每一台服务器安装agent脚本,然后通过中控机的API,来收集所需要的数据,最后放到数据库中,在通过web的方式显示出来. 实现流程图: 1.录入资产(主机名, ...
- java 字符串截取的方法
1.split()+正则表达式来进行截取. 将正则传入split().返回的是一个字符串数组类型.不过通过这种方式截取会有很大的性能损耗,因为分析正则非常耗时. String str = " ...
- 16.遇到就jar mismatch! Fix your dependencies的问题
这是因为两个项目的jar包(android-support-v4.jar)不一致. 解决方法是把2个jar都删除,然后各自加上最新的jar包 但是换了之后发现R文件编不出来,原因是minsdk的设置问 ...
- phpstudy2016 redis扩展 windows
第一步,查看环境的信息. 第二步,根据线程是否安全.架构32位或64位下载redis扩展. http://pecl.php.net/package-stats.php 第三步,php_redis.dl ...