Mysql tuner to tune mysql service

Install the mysql tuner to tune the mysql service to avoid any memory usage due to incorrect settings in the /etc/my.cnf file.

Login in to the server as root user and download the mysqltuner.pl file

root@linux7802 [~]# cd /usr/local/src/

root@linux7802 [/usr/local/src]# wget -O mysqltuner.pl mysqltuner.pl

root@linux7802 [/usr/local/src]# perl mysqltuner.pl

Above command will give you the statistics as well as recommendations to improve the server performance. As per recommendations made the necessary changes in the /etc/my.cnf file and retest the script to check, if issue resolved or not……

Note : Most of the time it recommend to optimize the mysql at that time use the following command but make sure that you have taken backup for the /var/lib/mysql directory to avoid any problem.

mysqlcheck –optimize -A

If you are having cPanel installed server than run the following command only.

/usr/local/cpanel/3rdparty/mysqltuner/mysqltuner.pl

It will ask you the MySQL administrative password which can be retrieve from the /etc/.my.cnf file

About Anant 384 Articles
Senior technical writer