[![Average time to resolve an issue](http://isitmaintained.com/badge/resolution/major/MySQLTuner-perl.svg)](http://isitmaintained.com/project/major/MySQLTuner-perl "Average time to resolve an issue")
[![Percentage of open issues](http://isitmaintained.com/badge/open/major/MySQLTuner-perl.svg)](http://isitmaintained.com/project/major/MySQLTuner-perl "Percentage of issues still open")
**MySQLTuner** is a script written in Perl that allows you to review a MySQL installation quickly and make adjustments to increase performance and stability. The current configuration variables and status data is retrieved and presented in a brief format along with some basic performance suggestions.
**MySQLTuner** supports ~300 indicators for MySQL/MariaDB/Percona Server in this last version.
**MySQLTuner** is maintained and indicator collect is increasing week after week supporting a lot of configuration such as [Galera Cluster](http://galeracluster.com/), [TokuDB](https://www.percona.com/software/mysql-database/percona-tokudb), [Performance schema](https://github.com/mysql/mysql-sys), Linux OS metrics, [InnoDB](http://dev.mysql.com/doc/refman/5.7/en/innodb-storage-engine.html), [MyISAM](http://dev.mysql.com/doc/refman/5.7/en/myisam-storage-engine.html), [Aria](https://mariadb.com/kb/en/mariadb/aria/), ...
You can find more details on these indicators here:
It is **extremely important** for you to fully understand each change
you make to a MySQL database server. If you don't understand portions
of the script's output, or if you don't understand the recommendations,
**you should consult** a knowledgeable DBA or system administrator
that you trust. **Always** test your changes on staging environments, and
always keep in mind that improvements in one area can **negatively affect**
MySQL in other areas.
It's **also important** to wait at least a day of uptime to get accurate results. In fact, running
**mysqltuner** on a fresh restarted server is completely useless.
**Seriously - please review the FAQ section below.**
Security recommendations
--
Hi directadmin user!
We detected that you run mysqltuner with da_admin's credentials taken from `/usr/local/directadmin/conf/my.cnf`, which might bring to a password discovery!
Read link for more details [Issue #289](https://github.com/major/MySQLTuner-perl/issues/289).
All checks done by **MySQLTuner** are documented in [MySQLTuner Internals](https://github.com/major/MySQLTuner-perl/blob/master/INTERNALS.md) documentation.
Download/Installation
--
Choose one of these methods:
1) Script direct download (the simplest and shortest method):
__Important__: [Text::Template](https://metacpan.org/pod/Text::Template) module is mandatory for `--reportfile` and/or `--template` options, because this module is needed to generate appropriate output based on a text template.
**Question: Can MySQL tuner make changes to my configuration automatically ?**
**No.**, MySQL tuner only provides recommendations. It does not make any changes to your configuration files automatically. It is up to the user to review the suggestions and implement them as needed.
**Question: How often should I run MySQL tuner ?**
It is recommended to run MySQL tuner periodically, especially after significant changes to your MySQL server or its workload.
For optimal results, run the script after your server has been running for at least 24 hours to gather sufficient performance data.
**Question: How do I interpret the results from MySQL tuner ?**
MySQL tuner provides output in the form of suggestions and warnings.
Review each recommendation and consider implementing the changes in your MySQL configuration file (usually 'my.cnf' or 'my.ini').
Be cautious when making changes and always backup your configuration file before making any modifications.
**Question: Can MySQL tuner cause harm to my database or server ?**
While MySQL tuner itself will not make any changes to your server, blindly implementing its recommendations without understanding the impact can cause issues.
Always ensure you understand the implications of each suggestion before applying it to your server.
**Question: Can I use MySQL tuner for optimizing other database systems like PostgreSQL or SQL Server ?**
MySQL tuner is specifically designed for MySQL servers.
To optimize other database systems, you would need to use tools designed for those systems, such as pgTune for PostgreSQL or SQL Server's built-in performance tools.
**Question: Does MySQL tuner support MariaDB and Percona Server ?**
Yes, MySQL tuner supports MariaDB and Percona Server since they are forks of MySQL and share a similar architecture. The script can analyze and provide recommendations for these systems as well.
**Question: What should I do if I need help with MySQL tuner or have questions about the recommendations ?**
If you need help with MySQL tuner or have questions about the recommendations provided by the script, you can consult the MySQL tuner documentation, seek advice from online forums, or consult a MySQL expert.
Be cautious when implementing changes to ensure the stability and performance of your server.
**Question: Will MySQLTuner fix my slow MySQL server ?**
**No.** MySQLTuner is a read only script. It won't write to any configuration files, change the status of any daemons, or call your mother to wish her a happy birthday. It will give you an overview of your server's performance and make some basic recommendations for improvements that you can make after it completes. *Make sure you read the warning above prior to following any recommendations.*
**Question: Why does MySQLTuner keep asking me the login credentials for MySQL over and over?**
The script will try its best to log in via any means possible. It will check for ~/.my.cnf files, Plesk password files, and empty password root logins. If none of those are available, then you'll be prompted for a password. If you'd like the script to run in an automated fashion without user intervention, then create a .my.cnf file in your home directory which contains:
[client]
user=someusername
password=thatuserspassword
Once you create it, make sure it's owned by your user and the mode on the file is 0600. This should prevent the prying eyes from getting your database login credentials under normal conditions. If a [T-1000 shows up in a LAPD uniform](https://en.wikipedia.org/wiki/T-1000) and demands your database credentials, you won't have much of an option.
**Question: Is there another way to secure credentials on latest MySQL and MariaDB distributions ?**
You could use mysql_config_editor utilities.
~~~bash
$ mysql_config_editor set --login-path=client --user=someusername --password --host=localhost
Enter password: ********
~~~
After which, `~/.mylogin.cnf` will be created with the appropriate access.
To get information about stored credentials, use the following command:
$mysql_config_editor print
[client]
user = someusername
password = *****
host = localhost
**Question: What's minimum privileges needed by a specific mysqltuner user in database ?**
mysql>GRANT SELECT, PROCESS,EXECUTE, REPLICATION CLIENT,SHOW DATABASES,SHOW VIEW ON *.* TO 'mysqltuner'@'localhost' identified by pwd1234;
**Question: It's not working on my OS! What gives?!**