分类: Mysql/postgreSQL
2010-08-11 11:52:40
mysql> USE tmp; mysql> SHOW CREATE TABLE test; ERROR 1017 (HY000): Can't find file: 'test' (errno: 2)
提示找不到文件,下面我们来处理错误,在tmp数据目录下建立 test.MYI 和 temp.MYD 文件,然后我们使用mysql自带
的修复表命令
1
mysql> repair TABLE test USE_FRM;
+------------------+--------+----------+----------+
| TABLE | Op | Msg_type | Msg_text |
+------------------+--------+----------+----------+
| test.test_myisam | repair | STATUS | OK |
+------------------+--------+----------+----------+
1 row IN SET (0.00 sec)
mysql> SHOW CREATE TABLE test \G;
*************************** 1. row **********
TABLE: test
CREATE TABLE: CREATE TABLE `test` (
`dd` varchar(1) NOT NULL,
`cc` varchar(1) NOT NULL
) ENGINE=myisam DEFAULT CHARSET=utf8
1 row IN SET (0.00 sec)
ERROR:
No query specified
mysql> INSERT INTO test (dd,cc) value(1,2);
Query OK, 1 row affected (0.00 sec)
mysql> SELECT * FROM test;
+------+
| dd | cc
+------+
| 1 |2
+------+
1 row IN SET (0.00 sec