mysqldump errno: 145

mysqldump failed on one table of testbbs database with error code 145 . It fail to open it’s index table . Probably the index file is corrupted.

# mysqldump –databases testbbs –single-transaction > testbbs.sql

mysqldump: Can’t get CREATE TABLE for table ‘test_events’ (Can’t open file: ‘test_events.MYI’. (errno: 145))

Do a check on the table with sql command “check table ” and repair it by “repair table”:

# mysql -u root -p testbbs

mysql> check table test_events

-> ;
+———————+——-+———-+——————————————————–+
| Table | Op | Msg_type | Msg_text |
+———————+——-+———-+——————————————————–+
| testbbs.test_events | check | warning | Table is marked as crashed |
| testbbs.test_events | check | warning | 2 clients is using or hasn’t closed the table properly |
| testbbs.test_events | check | warning | Not used space is supposed to be: 4528 but is: 4352 |
| testbbs.test_events | check | error | record delete-link-chain corrupted |
| testbbs.test_events | check | error | Corrupt |
+———————+——-+———-+——————————————————–+
5 rows in set (0.02 sec)

mysql> repair table test_events;

+———————+——–+———-+——————————————————+
| Table | Op | Msg_type | Msg_text |
+———————+——–+———-+——————————————————+
| testbbs.test_events | repair | info | Found block with too small length at 578536; Skipped |
| testbbs.test_events | repair | warning | Number of rows changed from 3939 to 3937 |
| testbbs.test_events | repair | status | OK |
+———————+——–+———-+——————————————————+
3 rows in set (1.46 sec)

After the table is repaired , do mysqldump can now be run successfully.

You may also like...