mysql修复损坏的表注意事项

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了mysql修复损坏的表注意事项相关的知识,希望对你有一定的参考价值。


参考资料:

http://blog.chinaunix.net/uid-405749-id-28215.html

http://www.cnblogs.com/xiaoit/p/3990304.html

http://www.jb51.net/article/25873.htm

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

mysql> 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> 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)

mysql> check table  tbl_referer05;

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

| Table                       | Op    | Msg_type | Msg_text |

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

| drnew_monitor.tbl_referer05 | check | status   | OK       |

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

1 row in set (5.16 sec)


mysql> 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> 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)


本文出自 “10931853” 博客,请务必保留此出处http://wujianwei.blog.51cto.com/10931853/1959436

以上是关于mysql修复损坏的表注意事项的主要内容,如果未能解决你的问题,请参考以下文章

如何在 mysql 中修复或删除/创建损坏的表?

EPLAN 注意 数据库可能已损坏 关闭系统 怎么解决

XFS 分区损坏修复方法

mysql修复表

如何修复 localhost xampp 中损坏的表“global_priv”

Mysql线上数据修复注意事项