Working with mysql-(2)

Status
Not open for further replies.

Albert.Nawaro

Active Member
88
2012
4
0
Drop or delete a table in MySQL


To delete a table, run



PHP:
 drop table table_name;



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



PHP:
 drop table db_name.table_name;



Only delete table if it is exists.



PHP:
 drop table if exists db_name.table_name;




Repair MyISAM table


To find list of corrupted tables



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


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

To check and repair all tables


PHP:
myisamchk --silent --force --fast --update-state /var/lib/mysql/DB_NAME/*.MYI
 
Status
Not open for further replies.
Back
Top