MySQL server comes with a default configuration that is suitable for most small websites. But for large websites, you may be using lower resources than you have, which may result in a slow website.

Just follow commands below to get some idea of how you can optimize your MySQL configuration.

To analyze system and get recommendations, we will be using mySQLtuner Perl script.

Step1: Downloading and making the script executable

cd ~ wget mv index.html chmod +x

Step2: Running tuner script and modifying your configuration file

./ nano /etc/my.cnf

Step3: Restarting your MySQL server (For CPanel Installations)


Step3: Restarting your MySQL server (For general installations)

service mysqld restart

You may need to repeat steps 2 and 3 a few times to find your best configuration results.

I hope this works out for you too, Enjoy!

* MySQL Tuner
* Enable the query cache in MySQL to improve performance