March 5

Восстановление поврежденной бд Mysql

В один момент очень сильно помогло.

Делая дамп базы user_database получаем ошибку:
mysqldump: Error 1194: TABLE 'ibf_spider_logs' IS marked AS crashed AND should be repaired when dumping TABLE `ibf_spider_logs` at row: 56215

Самый простой способ с которого нужно начинать это REPAIR TABLE.

Заходим по ssh на сервер и выполняем команду:
mysqldump -u user -p pass user_database -e 'repair table имя таблицы'
+--------------------------------------------+------+----------+---------------------------------------------------------------------+
| TABLE | Op | Msg_type | Msg_text |
+--------------------------------------------+------+----------+---------------------------------------------------------------------+
| user_database.ibf_spider_logs | repair | info | Wrong bytesec: 0- 0- 0 at 4393280; Skipped |
| user_database.ibf_spider_logs | repair | warning | Number of rows changed FROM 68174 TO 68173 |
| user_database.ibf_spider_logs | repair | STATUS | OK |
+--------------------------------------------+------+----------+---------------------------------------------------------------------+

или же из консоли mysql

mysqldump -u user -p pass
mysql> repair TABLE имя таблицы;
+--------------------------------------------+------+----------+---------------------------------------------------------------------+
| TABLE | Op | Msg_type | Msg_text |
+--------------------------------------------+------+----------+---------------------------------------------------------------------+
| user_database.ibf_spider_logs | repair | info | Wrong bytesec: 0- 0- 0 at 4393280; Skipped |
| user_database.ibf_spider_logs | repair | warning | Number of rows changed FROM 68174 TO 68173 |
| user_database.ibf_spider_logs | repair | STATUS | OK |
+--------------------------------------------+------+----------+---------------------------------------------------------------------+



Copyright © 2014. All rights reserved.

Posted March 5, 2014 by admin in category "mysql", "Базы данных