Error 'Incorrect key file for table 'test'
来源:互联网 发布:js 时间轴控件 编辑:程序博客网 时间:2024/05/13 11:09
1.版本
1)操作系统
cat /etc/issue
Red Hat Enterprise Linux Server release 5.5 (Tikanga)
Kernel \r on an \m
cat /proc/version
Linux version 2.6.32-504.el6.x86_64 (mockbuild@c6b9.bsys.dev.centos.org) (gcc version 4.4.7 20120313 (Red Hat 4.4.7-11) (GCC) ) #1 SMP Wed Oct 15 04:27:16 UTC 2014
2)mysql数据库版本
mysql --version
mysql Ver 14.14 Distrib 5.6.26, for linux-glibc2.5 (x86_64) using EditLine wrapper
2.问题描述
2.1 发现问题
今天发现测试环境的mysql从库报如下错误
Last_Error: Error 'Incorrect key file for table 'test'; try to repair it' on query. Default database: 'test2'. Query: 'alter table test add index ind_test_data1(data1)'
2.2问题分析
2.2.1 查看表结构
show create table test;+-------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+| Table | Create Table |+-------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+| test | CREATE TABLE `test` ( `id` int(11) NOT NULL, `int_k` int(11) NOT NULL, `data1` varchar(255) NOT NULL, `data2` varchar(255) NOT NULL, PRIMARY KEY (`id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8 |+-------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+##我们可以看到这是一张innodb表,id列为主键。
2.2.2 查看报错内容
从2.1的报错中我们可以看到,从库是在执行alter table test add index ind_test_data1(data1)时报的错,一个简单的添加索引命令会报错呢?,查看了从库的error log,发现有如下报错:
016-02-05 14:08:20 17073 [Warning] Disk is full writing './3306-relay-bin.000003' (Errcode: 28 - No space left on device). Waiting for someone to free space...2016-02-05 14:08:20 17073 [Warning] Retry in 60 secs. Message reprinted in 600 secs至此问题就清楚了,是因为从库的磁盘空间不够,所以在执行alter table的时候报错。(查了一下test是一个将近1000万记录的大表)
3.解决方案
给data目录添加空间后在从库执行 stop slave; 然后再执行start slave; 问题解决。
0 0
- Error 'Incorrect key file for table 'test'
- Incorrect key file for table ‘/tmp/#sql_181c
- MySql Incorrect key file for table *** 解决方法
- Incorrect key file for table错误解决方法
- ERROR:Incorrect key file for table 'table'; try to repair it
- /usr/sbin/mysqld: Incorrect key file for table './test/user.MYI'; try to repair it 解决
- 数据库出现 Incorrect key file for table ‘test’; try to repair it
- ERROR 126 (HY000): Incorrect key file for table '/tmp/#sql_1d87_0.MYI'; try to repair it
- MySQL Error Query database. Causejava.sql.SQLException: Incorrect key file for table ‘/tmp/#sql_181c
- 处理【Error Code: 126. Incorrect key file for table '表名'; 】
- 解决Incorrect key file for table /tmp/xxx.MYI
- mysql出现“Incorrect key file for table”解决办法
- Incorrect key file for table ‘/tmp/#sql_bd2_0.MYI’解决
- Incorrect key file for table '/tmp/....'错误的解决--记录
- Incorrect key file for table '/tmp/....'错误的解决--记录
- Mysql执行DDL语句错误-Incorrect key file for table
- mysql出现“Incorrect key file for table”解决办法
- MySQL: [ERROR] /usr/sbin/mysqld: Incorrect key file for table './xxx/xxxx.MYI'; try to repair it
- LogCat message: The Google Play services resources were not found. Check your project configuration
- 【一天搞定了,哈哈~】部署应用程序到android手机,adb命令
- 借助工具解决内存问题
- 自定义居于底部的选择国家的滚动选择器
- Ubuntu14.04安装搜狗输入法
- Error 'Incorrect key file for table 'test'
- hive导出数据导本地的方法
- 创建Android应用程序-从艰难的方式中学习获得的的30条经验教训
- 快速入门四 SSH2附带源码
- 沿海信标台站的说明(来源于网络)
- C++ and C Combination Compile Extern
- 《Android源码设计模式解析与实战》——Builder模式
- 以服务的方式运行软件
- bzoj1013: [JSOI2008]球形空间产生器