This post is a note for me to remember the common MySQL maintenance command. These MySQL maintenance command (check table, repair table, analyze table and optimize table) is very useful to ensure the MySQL database run smoothly and error free. Understanding these MySQL maintenance command will allow you to perform the right operation at the right time.
Here are the MySQL maintenance command simple brief:-
Advertisements
- CHECK TABLE
This command is mainly use to check table for errors. It support MyISAM and InnoDB - REPAIR TABLE
If there is error shown during the CHECK TABLE process, then you will need to use REPAIR TABLE to fix the error. - ANALYZE TABLE
This command analyze and store the key distribution for a table. During the operation, the table will be lock with READ LOCK. If your application perform a lot of DELETE and UPDATE operation, overtime you might need to perform ANALYZE TABLE to reorder the key distribution and improve the performance of the table. - OPTIMIZE TABLE
If you perform large amount of DELETE operation, you might need to perform OPTIMIZE TABLE to reclaim your unused space and defragment the data file. This command also suitable if you perform heavy UPDATE modification on your table, it helps to improve the performance of the statement that uses the table.
Credit: MySQL
Related posts:
Symfony2: How to get Doctrine Entity Manager in Console command
How to svn thru ssh in Linux / Mac
MySQL: Full text search for multiple words
How to convert doc file to pdf file in Win XP - PDFCreator
How to setup mysqldump without password in cronjob
How to clear play history in VLC media player
How to disable ssh root login?
Prestashop 1.6: "Unexpected token <" error when upload category thumbnail
Share this with your friends:-