{"id":18512,"date":"2016-02-01T15:00:45","date_gmt":"2016-02-01T21:00:45","guid":{"rendered":"https:\/\/www.rosehosting.com\/blog\/?p=18512"},"modified":"2022-06-03T03:43:51","modified_gmt":"2022-06-03T08:43:51","slug":"install-and-use-mysqltuner-on-ubuntu-14-04","status":"publish","type":"post","link":"https:\/\/www.rosehosting.com\/blog\/install-and-use-mysqltuner-on-ubuntu-14-04\/","title":{"rendered":"Install and use MySQLTuner on Ubuntu 14.04"},"content":{"rendered":"
MySQLTuner is a tool written in Perl which helps you increase the performance of your MySQL database server. It is really easy to use and it is recommended to analyze your Linux VPS<\/a> regularly in order to get the best performances. \u00a0In this tutorial we are going to show you how to install and use MySQLTuner on Ubuntu 14.04<\/strong>.<\/p>\n <\/p>\n First of all, login to your server and perform a system upgrade. It may take a few minutes but it is crucial for your server’s security. Use the following command to upgrade all your system software to the latest version available:<\/p>\n Once the upgrade is completed, you can proceed and install the MySQLTuner on your Ubuntu VPS<\/a>. There are two easy ways to do that and we will cover both in this tutorial.<\/p>\n The first way is to use the apt package manager. It is a little easier and faster way to install MySQLTuner on your server than the other one mentioned above. Since MySQLTuner is already added to the Ubuntu repositories, you can install it using the following command:<\/p>\n To run MySQLTuner, you can execute the command:<\/p>\n It could take a few moments before\u00a0the MySQLTuner provides you with the final report.<\/p>\n The other way to install MySQLTuner is to download the script from Git. This\u00a0is the preferable\u00a0way since it allows you to use the latest\u00a0version of the software.<\/p>\n Navigate to the \/opt directory on your server and download the latest version of MySQLTuner:<\/p>\n Make the script executable by using the command:<\/p>\n And finally, run the script using the command:<\/p>\n Or, if you do not like to make the script executable by adding the execute bit, you can directly call Perl to start the program by using the following command:<\/p>\n As a result, you should get something like this:<\/p>\n Once you get the final report and the MySQLTuner recommendations, you can make the changes to your MySQL database server settings. Of course, be careful while making the changes since you may lose some important data from your databases if something is set in a wrong way. If you are not sure about an issue, it is best to contact a MySQL expert in order to get the right answer. The best practice is to create a backup of your MySQL databases<\/a> before making any changes so you can restore the databases later if something goes\u00a0wrong.<\/p>\n Of course you don\u2019t have to do any of this if you use one of our Linux VPS hosting<\/a> services, in which case you can simply ask our expert Linux admins to install MySQLTuner<\/strong> for you. They are available 24\u00d77 and will take care of your request immediately.<\/p>\n PS<\/span>.<\/strong> If you liked this post please share it with your friends on the social networks using the buttons on the left or simply leave a reply below. Thanks.<\/p>\n","protected":false},"excerpt":{"rendered":" MySQLTuner is a tool written in Perl which helps you increase the performance of your MySQL database server. It is … <\/p>\nsudo apt-get update && sudo apt-get -y upgrade<\/pre>\n
sudo apt-get install mysqltuner<\/pre>\n
sudo mysqltuner<\/pre>\n
cd \/opt\/\r\nwget http:\/\/mysqltuner.pl\/ -O mysqltuner.pl\r\n<\/pre>\n
chmod +x mysqltuner.pl<\/pre>\n
.\/mysqltuner.pl<\/pre>\n
perl mysqltuner.pl<\/pre>\n
-------- Recommendations -----------------------------------------------------\r\nGeneral recommendations:\r\n Run OPTIMIZE TABLE to defragment tables for better performance\r\n Reduce or eliminate unclosed connections and network issues\r\n When making adjustments, make tmp_table_size\/max_heap_table_size equal\r\n Reduce your SELECT DISTINCT queries which have no LIMIT clause\r\nVariables to adjust:\r\n query_cache_type (=1)\r\n tmp_table_size (> 16M)\r\n max_heap_table_size (> 16M)\r\n<\/pre>\n