崩溃后:
mysql> repair table lot_not_sold;
+------------------------+--------+----------+---------------------------------------------------------------+
| Table | Op | Msg_type | Msg_text |
+------------------------+--------+----------+---------------------------------------------------------------+
| coinprice.lot_not_sold | repair | info | Found block with too small length at 126188; Skipped |
| coinprice.lot_not_sold | repair | info | Wrong block with wrong total length starting at 147688 |
| coinprice.lot_not_sold | repair | info | Wrong bytesec: 4-253-223 at 9784004; Skipped |
| coinprice.lot_not_sold | repair | info | Wrong bytesec: 48- 32-208 at 11538216; Skipped |
| coinprice.lot_not_sold | repair | info | Delete link points outside datafile at 4036632 |
| coinprice.lot_not_sold | repair | info | Wrong bytesec: 0- 0- 0 at 1405636; Skipped |
.... rows were skipped a lot ....
| coinprice.lot_not_sold | repair | warning | Number of rows changed from 113619 to 115277 |
| coinprice.lot_not_sold | repair | status | OK |
+------------------------+--------+----------+---------------------------------------------------------------+
616 rows in set (1.77 sec)
这里有更多输出,但是由于大小限制,我也不得不跳过很多行。
SELECT * FROM coinprice.lot_not_sold ORDER BY site DESC limit 2;
+------------+----------------------------+---------------------+--------+------+------------+------------+------+
| id | fulltitle | added | finish | site | startprice | blitzprice | url |
+------------+----------------------------+---------------------+--------+------+------------+------------+------+
| 2924913561 | tttt 10 tttttttt 2001 ttttt| ▒338-14-08 91:97:60 | NULL | 78 | 0.000 | 4.379 | NULL |
| 2926483072 | Zamek w Krniku - 2z - 1998 | 2013-01-06 06:40:01 | NULL | 5 | 2.839 | 0.000 | NULL |
+------------+----------------------------+---------------------+--------+------+------------+------------+------+
2 rows in set (0.00 sec)
请注意added
,第一行显然不正确。
mysql> delete from lot_not_sold where site>5;
ERROR 1032 (HY000): Can't find record in 'lot_not_sold'
尝试检查:
mysql> check table lot_not_sold extended;
+------------------------+-------+----------+----------+
| Table | Op | Msg_type | Msg_text |
+------------------------+-------+----------+----------+
| coinprice.lot_not_sold | check | status | OK |
+------------------------+-------+----------+----------+
1 row in set (2.95 sec)
接下来尝试再次选择、删除、修复 - 并始终得到相同的结果。
mysql> show create table lot_not_sold;
CREATE TABLE `lot_not_sold` (
`id` int(11) unsigned NOT NULL,
`fulltitle` varchar(120) NOT NULL,
`added` datetime NOT NULL,
`finish` datetime DEFAULT NULL COMMENT 'дата закрытия торгов',
`site` tinyint(4) NOT NULL,
`startprice` float(8,3) unsigned NOT NULL,
`blitzprice` float(8,3) unsigned DEFAULT NULL,
`url` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`,`site`,`added`),
KEY `IX_lot_not_sold_added` (`added`),
KEY `IX_lot_not_sold_finish` (`finish`),
KEY `IX_lot_not_sold_site` (`site`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AVG_ROW_LENGTH=114
/*!50100 PARTITION BY HASH (DAY(added))
PARTITIONS 4 */
是否可以修复此错误?repair
由于添加了〜2k行,是否可能有很多错误?
我用谷歌搜索了一些提到非常老的错误的页面,但我的实例并不太旧:
mysql Ver 14.14 Distrib 5.1.66, for redhat-linux-gnu (x86_64) using readline 5.1
选择 MyISAM 是因为性能原因。现在我正在考虑切换到 InnoDB - 这是正确的方法吗?此表不断修改。
谢谢你。
您可以尝试使用
REPAIR TABLE myTable USE_FRM
“可能”您的
.MYI
文件丢失或标题损坏但是,在继续之前检查您的MySQL 5.1 版本的文档并为您 的、 和文件制作备份副本以避免数据丢失
.MYI
.frm
.MYD