天天看点

mysql修复损坏的表注意事项

参考资料:

<a href="http://blog.chinaunix.net/uid-405749-id-28215.html" target="_blank">http://blog.chinaunix.net/uid-405749-id-28215.html</a>

<a href="http://www.cnblogs.com/xiaoit/p/3990304.html" target="_blank">http://www.cnblogs.com/xiaoit/p/3990304.html</a>

<a href="http://www.jb51.net/article/25873.htm" target="_blank">http://www.jb51.net/article/25873.htm</a>

线上操作恢复损坏表的过程:

mysql&gt; check table  tbl_referer05;

+-----------------------------+-------+----------+-----------------------------------------------------------+

| Table                       | Op    | Msg_type | Msg_text                                                  |

| drnew_monitor.tbl_referer05 | check | warning  | Table is marked as crashed and last repair failed         |

| drnew_monitor.tbl_referer05 | check | warning  | 10 clients are using or haven't closed the table properly |

| drnew_monitor.tbl_referer05 | check | warning  | Size of datafile is: 672742692       Should be: 672710844 |

| drnew_monitor.tbl_referer05 | check | error    | Found 72 keys of 1998767                                  |

| drnew_monitor.tbl_referer05 | check | error    | Corrupt                                                   |

5 rows in set (0.00 sec)

mysql&gt; repair table tbl_referer05;;

+-----------------------------+--------+----------+---------------------------------------------------------+

| Table                       | Op     | Msg_type | Msg_text                                                |

| drnew_monitor.tbl_referer05 | repair | info     | Found block with too small length at 152960; Skipped    |

| drnew_monitor.tbl_referer05 | repair | info     | Found block with too small length at 184660; Skipped    |

| drnew_monitor.tbl_referer05 | repair | info     | Wrong bytesec: 101- 98- 75 at 488558800; Skipped        |

| drnew_monitor.tbl_referer05 | repair | info     | Found block with too small length at 965508; Skipped    |

| drnew_monitor.tbl_referer05 | repair | info     | Found block with too small length at 985580; Skipped    |

| drnew_monitor.tbl_referer05 | repair | info     | Found block with too small length at 989772; Skipped    |

| drnew_monitor.tbl_referer05 | repair | info     | Wrong bytesec: 116-116-112 at 488561736; Skipped        |

| drnew_monitor.tbl_referer05 | repair | info     | Found block with too small length at 2422076; Skipped   |

| drnew_monitor.tbl_referer05 | repair | info     | Found block with too small length at 2876164; Skipped   |

| drnew_monitor.tbl_referer05 | repair | info     | Wrong bytesec:  51- 48- 49 at 488606848; Skipped        |

| drnew_monitor.tbl_referer05 | repair | info     | Found block with too small length at 3184428; Skipped   |

| drnew_monitor.tbl_referer05 | repair | info     | Wrong bytesec: 105- 46- 99 at 488626364; Skipped        |

| drnew_monitor.tbl_referer05 | repair | info     | Wrong bytesec:  52- 51- 46 at 488626384; Skipped        |

| drnew_monitor.tbl_referer05 | repair | info     | Found block with too small length at 3910968; Skipped   |

| drnew_monitor.tbl_referer05 | repair | info     | Wrong bytesec:  37- 50- 50 at 488642480; Skipped        |

| drnew_monitor.tbl_referer05 | repair | info     | Wrong bytesec:  50- 50- 54 at 488642504; Skipped        |

| drnew_monitor.tbl_referer05 | repair | info     | Found block with too small length at 4270476; Skipped   |

| drnew_monitor.tbl_referer05 | repair | info     | Found block with too small length at 4278508; Skipped   |

| drnew_monitor.tbl_referer05 | repair | info     | Found block with too small length at 4812248; Skipped   |

| drnew_monitor.tbl_referer05 | repair | info     | Wrong bytesec:  59- 32-122 at 488696156; Skipped        |

| drnew_monitor.tbl_referer05 | repair | info     | Found block with too small length at 5240200; Skipped   |

| drnew_monitor.tbl_referer05 | repair | info     | Found block with too small length at 5272204; Skipped   |

| drnew_monitor.tbl_referer05 | repair | info     | Wrong bytesec:  15-  0- 36 at 488710432; Skipped        |

| drnew_monitor.tbl_referer05 | repair | info     | Found block with too small length at 5840716; Skipped   |

| drnew_monitor.tbl_referer05 | repair | info     | Found block with too small length at 5864136; Skipped   |

| drnew_monitor.tbl_referer05 | repair | info     | Found block with too small length at 5887872; Skipped   |

| drnew_monitor.tbl_referer05 | repair | info     | Delete link points outside datafile at 488724136        |

| drnew_monitor.tbl_referer05 | repair | info     | Found block with too small length at 6467604; Skipped   |

| drnew_monitor.tbl_referer05 | repair | info     | Wrong bytesec:  53- 46- 55 at 488748676; Skipped        |

| drnew_monitor.tbl_referer05 | repair | info     | Found block with too small length at 6736884; Skipped   |

| drnew_monitor.tbl_referer05 | repair | info     | Found block with too small length at 6744696; Skipped   |

| drnew_monitor.tbl_referer05 | repair | info     | Found block with too small length at 6949524; Skipped   |

| drnew_monitor.tbl_referer05 | repair | info     | Found block with too small length at 6993404; Skipped   |

| drnew_monitor.tbl_referer05 | repair | info     | Found block with too small length at 7012028; Skipped   |

| drnew_monitor.tbl_referer05 | repair | info     | Wrong bytesec: 116-112- 58 at 488789212; Skipped        |

| drnew_monitor.tbl_referer05 | repair | info     | Found block with too small length at 7475056; Skipped   |

| drnew_monitor.tbl_referer05 | repair | info     | Found block with too small length at 7636404; Skipped   |

| drnew_monitor.tbl_referer05 | repair | info     | Found block with too small length at 7725468; Skipped   |

| drnew_monitor.tbl_referer05 | repair | info     | Found block with too small length at 7744088; Skipped   |

| drnew_monitor.tbl_referer05 | repair | info     | Wrong bytesec:  24-  0-133 at 488825908; Skipped        |

| drnew_monitor.tbl_referer05 | repair | info     | Found block with too small length at 8226208; Skipped   |

| drnew_monitor.tbl_referer05 | repair | info     | Found block with too small length at 8286068; Skipped   |

| drnew_monitor.tbl_referer05 | repair | info     | Wrong bytesec:  53- 54- 47 at 488843692; Skipped        |

| drnew_monitor.tbl_referer05 | repair | info     | Wrong bytesec:  59- 32-119 at 488857180; Skipped        |

| drnew_monitor.tbl_referer05 | repair | info     | Found block with too small length at 8646640; Skipped   |

| drnew_monitor.tbl_referer05 | repair | info     | Wrong bytesec: 101-114- 47 at 488868524; Skipped        |

| drnew_monitor.tbl_referer05 | repair | info     | Found block with too small length at 8909900; Skipped   |

| drnew_monitor.tbl_referer05 | repair | info     | Found block with too small length at 8975320; Skipped   |

| drnew_monitor.tbl_referer05 | repair | info     | Found block with too small length at 8995780; Skipped   |

| drnew_monitor.tbl_referer05 | repair | info     | Found block with too small length at 583596204; Skipped |

| drnew_monitor.tbl_referer05 | repair | info     | Found block with too small length at 594127704; Skipped |

| drnew_monitor.tbl_referer05 | repair | info     | Found block with too small length at 594215860; Skipped |

| drnew_monitor.tbl_referer05 | repair | warning  | Number of rows changed from 1998767 to 1951358          |

| drnew_monitor.tbl_referer05 | repair | status   | OK                                                      |

163 rows in set (26.67 sec)

+-----------------------------+-------+----------+----------+

| Table                       | Op    | Msg_type | Msg_text |

| drnew_monitor.tbl_referer05 | check | status   | OK       |

1 row in set (5.16 sec)

mysql&gt; repair table tbl_referer05;

+-----------------------------+--------+----------+----------+

| Table                       | Op     | Msg_type | Msg_text |

| drnew_monitor.tbl_referer05 | repair | status   | OK       |

1 row in set (26.54 sec)

mysql&gt; repair table tbl_referer06;;

+-----------------------------+--------+----------+-----------------------------------------------------------+

| Table                       | Op     | Msg_type | Msg_text                                                  |

| drnew_monitor.tbl_referer06 | repair | info     | Wrong block with wrong total length starting at 414722584 |

| drnew_monitor.tbl_referer06 | repair | warning  | Number of rows changed from 1440927 to 1440926            |

| drnew_monitor.tbl_referer06 | repair | status   | OK                                                        |

3 rows in set (26.94 sec)

 本文转自 wjw555 51CTO博客,原文链接:http://blog.51cto.com/wujianwei/1959436

继续阅读