A simple tip to speeding up MySQL

Find your WordPress install sluggish? Caching not making a difference. Try adding the following lines to your MySQL servers my.cnf.

query_cache_type = 1
query_cache_size = 20M

Alot of MySQL default installations have the query_cache_size set to 0 (the default), disabling the cache. By setting it’s value to something greater than 0, it brings the cache, and your site, to life.

Check out the MySQL documentation at http://dev.mysql.com/doc/refman/5.0/en/query-cache-configuration.html for details.

How to check, repair and optimize all your tables in MySQL

It’s a simple one liner:

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

Obviously if your current user doesn’t have the rights, you’ll need to use a user that does.