1] Check the permission and ownership of database i.e. it should be same below
Code: Select all
drwx-- 2 MySQL Server mysql cpanelusername_dbname.
2] If the permission are corrects but some error occurs then it seems that your database table may be corrupts then there are following way to repair the DB
a) Go to whm >>SQL Services >> Repair a Database >> select database name and click Repair Database.
b) Go to cpanel >> MySQL Server section MySQL Account Maintenance >> search database then click on Repair.
3] You can repair it though shell when mysqld server is running
i) login in MySQL Server to that particular user by using following command
Code: Select all
mysql>mysql -u databaseusername -p databasename
ii) select particular database
Code: Select all
mysql> use databasename;
iii) Check whether database table is corrupted or not if following command output shows null value then it should be corrupts otherwise it is fine
Code: Select all
mysql>show table status like table name \G; Or
mysql>check table tablename ;
iv)If it is corrupts then use the following command to repair that particular database table.
Code: Select all
mysql>repair table tablename;
4] You can repair it though shell when mysqld server is not running
Repairing MyISAM mySQL Tables/Databases:
Code: Select all
# cd /var/lib/mysql/DBNAME
# myisamchk tablename.MYI
Repairing ISAM mySQL Tables/Databases:
Code: Select all
# cd /var/lib/mysql/DBNAME
isamchk tablename.MYI
where
-c -> check database is corrupted or not
-r -> recorver
-o -> optimise the database
No comments:
Post a Comment