Pages

Showing posts with label Table Maintenence. Show all posts
Showing posts with label Table Maintenence. Show all posts

Jun 5, 2012

MySQL Table Corruption - Automatic Maintenence

Whether you're running WordPress or any other software powered by MySQL, you are relying on MySQL tables always being available and problem free.

Unfortunately MySQL table corruption is a fact of life. 

Network latency, server shutdown, hard drive running out of space and memory defragmentation are just some causes of MySQL table corruption.

A corrupted MySQL table could render your site useless, lead to loss of revenues and basically make your life a living hell.

MySQL offers two command-line tools to check for table corruption:

* mysqlcheck - uses the SQL statements CHECK TABLE, ANALYZE TABLE, and OPTIMIZE TABLE. To invoke mysqlcheck for checking all of your databases you run: mysqlcheck --all-databases

myisamchk - runs on the raw MySQL files, bypassing the server, myisamchk is faster but unlike mysqlcheck cannot be executed while the server is running.