If you are getting an MySQL related error on your site for any database, you can repair the database through SSH from MySQL prompt.
For example:
Invalid SQL: SELECT * FROM `something` WHERE `id` = '151' ORDER BY `someid` ASC LIMIT 0,20; (Can't open file: 'sometable.MYI' (errno: 145))
Login to your server as root.
Firstly check the status of MySQL on your dedicated server. Normally, it should be ok – as you’re getting this error.
The database table can be repaired only if the Mysql server is in running status. You can check the status by the command.
root# /etc/init.d/myssql status
Now, login to the MySQL database for a required user.
mysql> mysql –u databaseusername –p database password databasename
You need to select that particular database having problem.
mysql> use databasename;
Now, you will have to check whether the table is corrupted. On giving the below command you will get a NULL value as your output if it is corrupted otherwise it’s alright.
mysql> check table tablename;
If the table is corrupted for that particular database, then you need
to repair the table by giving the following command.
mysql> repair table tablename;
This will repair the table for you.
This article is released by SupportFacility.Com — the leaders in providing outsourced technical support, live chat support & help desk support for web hosts. Interested ? Opt for a trial now.



