Improve MySQL / MariaDB Performance With MySQLTuner

MySQLTuner is a Perl script that will analyze the performance of MySQL / MariaDB databases, and from the results of this analysis, MySQL Tuner will provide recommendations on which variables should be increased or decreased, in order to increase performance. That way, we can “tuning” the my.cnf file so that the MySQL / MariaDB database server performance is optimal and works more efficiently.

First of all we download the MySQLTuner file first with the command:


Then we first chmod it so it can run:

chmod + x

Then we run MySQLTuner with the command:


NOTES: You must be logged in as root to run the above command.

The output of the above command is as follows:

server1: ~ # ./ >> MySQLTuner 0.9.8 - Major Hayden 
 >> Bug reports, feature requests, and downloads at >> Run with '--help' for additional options and output filtering Please enter your MySQL administrative login:  16M) tmp_table_size (> 32M) max_heap_table_size (> 16M) table_cache (> 64) server1: ~ #

Look at the bottom of the output that says “Recommendations“, Where are the recommendations and variables that you should change to improve MySQL / MariaDB performance.

Open file my.cnf at location /etc/mysql/my.cnf and change the variables as recommended. When finished restart MySQL / MariaDB with the command

mysql service restart

Periodically check the performance of MySQL / MariaDB with MySQLTuner, at least 24 hours you run this script.

Share on facebook


Share on twitter


Share on whatsapp


Share on telegram


Share on e-mail



Source link

Leave a Reply

Your email address will not be published. Required fields are marked *