MySQLCheck For Quick Repair


Thanks to this tip on the Taragana blog, I was introduced to the mysqlcheck command. In a pinch, the following command will check, repair and optimize all tables in all databases on your MySQL server instance.

mysqlcheck -u root -p --auto-repair --check --optimize --all-databases

mysqlcheck is available in MySQL 3.23.38 and later.

The official documentation for mysqlcheck says: “The mysqlcheck client performs table maintenance: It checks, repairs, optimizes, or analyzes tables.” Now, this must be run on a MySQL instance that is currently running, unlike the myisamchk tool. So, you may want to stop all access to your instance. If you are using it for websites, perhaps kill HTTPD for a few minutes some other means.

Popularity: 3% [?]

Tags: ,

About Tom

Christ follower, husband, father, technology and photography enthusiast. Attempting to live life out as a light in this world and stumbling at times in this fallen world. Got a topic you want to have me look into? Did I miss something in a post? Let me know. Just add a comment below.