MYSQL ERROR 1051 (42S02): Unknown table corrupttablename

Posted by Md. Mahidul Hasan on 11:12 PM with No comments

Very rare we got a message to the browser saying "Unknown table tablename". Though we have the database and the table properly to the server. To solve the issue, we need to follow the below steps-

ERROR 1051 (42S02): Unknown table corrupttablename

[root@db ~]# service mysqld stop
[root@db ~]# mv /var/lib/mysql/database_name/corrupttablename.frm /tmp
[root@db ~]# service mysqld start