MySQL Database

ID #230

A MySQL MYI table has errors in it.

Applies to: Grid System

If you see these type of error messages from MySQL:

Database failed to execute query (query) 1016: Can't open file: 'sometable.MYI'. (errno: 145)
Error Msg: 1034: Incorrect key file for table: 'sometable'. Try to repair it

thenb you probably have a crashed or corrupt table.

You can check and repair the table from a mysql prompt like this:

check table sometable;
+------------------+-------+----------+----------------------------+
| Table | Op | Msg_type | Msg_text |
+------------------+-------+----------+----------------------------+
| yourdb.sometable | check | warning | Table is marked as crashed |
| yourdb.sometable | check | status | OK |
+------------------+-------+----------+----------------------------+

repair table sometable;
+------------------+--------+----------+----------+
| Table | Op | Msg_type | Msg_text |
+------------------+--------+----------+----------+
| yourdb.sometable | repair | status | OK |
+------------------+--------+----------+----------+


and now your table should be fine:

check table sometable;
+------------------+-------+----------+----------+
| Table | Op | Msg_type | Msg_text |
+------------------+-------+----------+----------+
| yourdb.sometable | check | status | OK |
+------------------+-------+----------+----------+


Last update: 2010-10-03 16:43
Author: FAQ Admin
Revision: 1.2

Digg it! Share on Facebook Print this record Send FAQ to a friend Show this as PDF file
Please rate this FAQ:

Average rating: 2.67 (3 Votes)

completely useless 1 2 3 4 5 most valuable

You can comment this FAQ