Category: MySQL

If you see these types of error messages from MySQL database:

Database failed to execute query (query) 1016: Can't open file: 'sometable.MYI'. (errno: 145)

Error Msg: 1034: Incorrect key file for table: 'sometable'. 

You can check and repair the table from a mysql prompt as follows: (mysql prompt is available from your DB admin tool within Plesk – phpmyAdmin)

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 | 

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

Your table should now be fine

Tags:

mySQL

How useful was this post?

Click on a star to rate it!

Average rating / 5. Vote count:

No votes so far! Be the first to rate this post.