Skip to content
EuroVPSEuroVPS

How to tune and optimise MySQL using MySQLTuner

EuroVPS FAQ

Updated 1 min read

MySQLtuner is an open source perl script which analyzes your MySQL performance / collect necessary information and will give recommendations to adjust variables/parameters that you should adjust in order to increase performance.

Steps to Optimize MySQL configuration using MySQLTuner

1. Download MySQL tuner 

wget http://mysqltuner.com/mysqltuner.pl

2. Update permission

Make the script executable.

chmod +x mysqltuner.pl

3. Run MySQL tuner

./mysqltuner.pl

The output shows exactly which variables you should adjust in the [mysqld] section on your my.cnf - MySQL configuration file.

Tuning and update configuration

Treat the MySQLTuner output as a hint, not as a configuration to paste. Size innodb_buffer_pool_size to the working set of your data, and leave the other variables close to their defaults unless a measurement says otherwise.

Here is one sample my.cnf file.

# cat /etc/my.cnf

[mysqld]

innodb_file_per_table=1 innodb_buffer_pool_size=4G innodb_log_file_size=512M max_connections=200 tmp_table_size=64M max_heap_table_size=64M table_open_cache=4096 max_allowed_packet=256M

[mysqldump]

max_allowed_packet = 500M

5. Restart mysql server

Restart to apply:

service mysql restart

You can run MySQLTuner multiple times to check if it has further recommendations to improve the MySQL performance.

From the EuroVPS FAQ.

More in how to

Your next infrastructure partner

Still have
a question?

Tell us what you are trying to do. An engineer will read it and reply.

+357 222 32280
A EuroVPS engineer carrying a server node on the datacenter floor
A conversation with the people
who will look after your infrastructure.

Let’s start with your setup.

A little context helps us start the right conversation.

We’ll use your details to respond to your enquiry. Privacy policy