How to Optimize MySQL
2013-11-08
79 words
1 min read
Today I found my websites were very slow. Log into linode system and I found MySQL is over 500% CPU usage.
Just google it. and found a script.
Just google it. and found a script.
- wget https://raw.github.com/major/MySQLTuner-perl/master/mysqltuner.pl
- use winscp to change the pl file to 777
- use putty to telnet the server.
- Just run the pl. ./mysqltuner.pl
- The pl will display some setting suggestion. change ./etc/mysql/my.cnf
- Use the following command to optimize database tables
mysqlcheck --optimize -A -u username -ppassword
- service mysql restart
- That's all.
Authored By Jesse Lau
A freelancer living in New Zealand, engaged in website development and program trading. Ever won 1st ranking twice in the Dukascopy Strategy Contest. This article is licensed under a Creative Commons Attribution 4.0 International License.