Drop or delete a table in MySQL


To delete a table, run



PHP Code: 
 drop table table_name



This need to be done while you use the database or run following command.



PHP Code: 
 drop table db_name.table_name



Only delete table if it is exists.



PHP Code: 
 drop table if exists db_name.table_name




Repair MyISAM table


To find list of corrupted tables



PHP Code: 
 myisamchk /var/lib/mysql/DB_NAME/*.MYI >> /root/1.txt 


To rapier a table
PHP Code: 
      cd  /var/lib/mysql/DB_NAME
myisamchk -r TABLE_NAME_HERE.MYI 

To check and repair all tables


PHP Code: 
myisamchk --silent --force --fast --update-state /var/lib/mysql/DB_NAME/*.MYI 
Albert.Nawaro Reviewed by Albert.Nawaro on . Working with mysql-(2) Drop or delete a table in MySQL To delete a table, run drop table table_name; Rating: 5