ERROR 1194 (HY000): Table 't1' is marked as crashed and should be repaired
来源:互联网 发布:勇者之塔魂力强化数据 编辑:程序博客网 时间:2024/05/22 17:34
今天测试mysql,发现一个表出现了以下报错
ERROR 1194 (HY000): Table 't1' is marked as crashed and should be repaired
在网上搜有些说需要通下面方法进行修复
[root@localhost data]# myisamchk -f ./test2/*.MYI
Checking MyISAM file: ./test2/t1.MYI
Data records: 24926 Deleted blocks: 0
- check file-size
myisamchk: error: Size of datafile is: 73 Should be: 174482
- recovering (with keycache) MyISAM-table './test2/t1.MYI'
Data records: 24926
Data records: 5
---------
Checking MyISAM file: ./test2/t2.MYI
Data records: 482688 Deleted blocks: 0
- check file-size
- check record delete-chain
- check key delete-chain
- check index reference
- check data record references index: 1
- check record links
---------
Checking MyISAM file: ./test2/t4.MYI
Data records: 482688 Deleted blocks: 0
- check file-size
- check record delete-chain
- check key delete-chain
- check index reference
---------
Checking MyISAM file: ./test2/t5.MYI
Data records: 482688 Deleted blocks: 0
- check file-size
- check record delete-chain
- check key delete-chain
- check index reference
- check record links
然后在mysql 里使用repair中进行修复,成功。
mysql> repair table cmxt.cm_user_pref;
+-------------------+--------+----------+----------+
| Table | Op | Msg_type | Msg_text |
+-------------------+--------+----------+----------+
| cmxt.cm_user_pref | repair | status | OK |
+-------------------+--------+----------+----------+
后来经过实验发现
首先检查check table t1
mysql> check table t1;
+----------+-------+----------+---------------------------------------------------+
| Table | Op | Msg_type | Msg_text |
+----------+-------+----------+---------------------------------------------------+
| test2.t1 | check | error | Size of datafile is: 73 Should be: 174482 |
| test2.t1 | check | error | Corrupt |
+----------+-------+----------+---------------------------------------------------+
2 rows in set (0.00 sec)
然后再使用myisamchk来修复
[root@localhost mysql]# myisamchk -f ./data/test2/t1.MYI
Checking MyISAM file: ./data/test2/t1.MYI
Data records: 24926 Deleted blocks: 0
myisamchk: warning: Table is marked as crashed
- check file-size
myisamchk: error: Size of datafile is: 73 Should be: 174482
- recovering (with keycache) MyISAM-table './data/test2/t1.MYI'
Data records: 24926
Data records: 5
然后再查看t1表
mysql> select * from t1;
+-------------+
| str_number |
+-------------+
| NULL |
| NULL |
| -1774844896 |
| NULL |
| NULL |
+-------------+
5 rows in set (0.00 sec)
- ERROR 1194 (HY000): Table 't1' is marked as crashed and should be repaired
- mysql错误:ERROR 145 (HY000): Table './zentao/zt_action' is marked as crashed and should be repaired
- Table 'table_name' is marked as crashed and should be repaired
- Table 'xxxxxxx' is marked as crashed and should be repaired
- Table ‘xxx’ is marked as crashed and should be repaired ...
- linux Table is marked as crashed and should be repaired
- Table '.\tablename' is marked as crashed and should be repaired
- Table 'user_xxxxx' is marked as crashed and should be repaired
- Table is marked as crashed and should be repaired
- Error 'Table './csf/tmp_excel_data' is marked as crashed and should be repaired' on opening tables
- MySQL error: 145 (Table 'xxx' is marked as crashed and should be repaired
- repair table `site_user`,#1194 – Table is marked as crashed and should be repaired错误修复
- 修复 Table marked as crashed and should be repaired
- Table xxxis marked as crashed and should be repaired
- 表 is marked as crashed and should be repaired
- mysql错误:is marked as crashed and should be repaired
- is marked as crashed and should be repaired
- mysql错误is marked as crashed and should be repaired
- 淘宝的数据解决方案:datax - DataX产品说明
- FLATRO OPENCART 自适应多用途主题模板 ABC-0054
- socket原理
- sql如何查询主键
- Mathematica 清除变量的值
- ERROR 1194 (HY000): Table 't1' is marked as crashed and should be repaired
- MVC5使用
- hdu 5294 Tricks Device 2015 Multi-University Training Contest 1
- 如何建立高效的测试团队
- windows cmd 查看端口占用
- 3.第三单元任务二实训:使用作业提交系统提交Java作业时 ,需要输入Java源代码文件名和自己的邮箱,提交前对Java文件名以及邮箱进行有效检查。编写程序实现对输入的Java源文件名以及邮箱有效性的
- 怎样往linux社区提交代码
- Swift 操作数据库
- 利用 ProtoThreads实现Arduino多线程处理