jump to navigation

Tuning MySql with MySqlTuner March 8, 2011

Posted by Tournas Dimitrios in Uncategorized.

mysqltuner is a high-performance MySQL tuning script written in perl that will provide you with a snapshot of a MySQL server’s health. Based on the statistics gathered, specific recommendations will be provided that will increase a MySQL server’s efficiency and performance.It can be very useful tool in many cases, like for ex:

  • it gives a quick overview on your running mysql configuration and some common sense recommendations.
  • it computes the total amount of memory needed for the current configuration (assuming all global buffers will be used and the maximum number of threads being connected).
  • very simple usage: you just have to download and run it.
  1. If EPEL is on the repository list of CentOs 5.x , yum will automate the installation process .
    yum install  mysqltuner
    == OR ==
    wget  http://mysqltuner.com/mysqltuner.pl
    chmod +x  mysqltuner.pl
  2. Run the script :
    mysqltuner (yum installation)
    (wget installation)
  3. Input your MySql administrative login and password
    Please enter your MySQL administrative login:
    Please enter your MySQL administrative password:
  4. Adjust your MySql config file (/etc/mysql/my.cnf) according to the recommendations. Don’t increase or decrease the values too much because it may have negative impact on the server. If this is a production server, just make minor changes each time and test again a few hours/days later and adjust the values again if needed. It may take a few days to figure out the best values for your server.
  5. Restart MySql after you have made changes to the config file
    service mysqld restart

Here is an sample of my development environment server .


No comments yet — be the first.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s