From 875235351b3c1112004cb5b84ab69d04a988ead5 Mon Sep 17 00:00:00 2001 From: leslitagordita Date: Tue, 8 Jan 2019 09:42:35 -0500 Subject: [PATCH] Update script installation steps --- .../index.md | 27 ++++++++++++------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/docs/databases/mysql/how-to-optimize-mysql-performance-using-mysqltuner/index.md b/docs/databases/mysql/how-to-optimize-mysql-performance-using-mysqltuner/index.md index a77c4d21ccb..2f279347024 100644 --- a/docs/databases/mysql/how-to-optimize-mysql-performance-using-mysqltuner/index.md +++ b/docs/databases/mysql/how-to-optimize-mysql-performance-using-mysqltuner/index.md @@ -6,7 +6,7 @@ description: 'This step-by-step guide shows you how to assess your MySQL databas keywords: ["mysql", " mysqltuner", " tune mysql", " resource tuning"] aliases: ['databases/mysql/tuning-your-mysql-database/','databases/mysql/mysql-performance-tuning-tutorial/'] license: '[CC BY-ND 4.0](https://creativecommons.org/licenses/by-nd/4.0)' -modified: 2017-06-27 +modified: 2019-01-08 modified_by: name: Linode published: 2015-02-27 @@ -38,12 +38,21 @@ In order to determine if your MySQL database needs to be reconfigured, it is bes The [MySQLTuner](http://mysqltuner.com/) script assesses your MySQL installation, and then outputs suggestions for increasing your server's performance and stability. -1. Download and run MySQLTuner: +1. Download the MySQLTuner script: - curl -L http://mysqltuner.pl/ | perl + wget http://mysqltuner.com/mysqltuner.pl -2. It outputs your results: +1. Change the scripts permissions to be executable: + chmod +x mysqltuner.pl + +1. Run the `mysqltuner.pl` script. You will be prompted to enter in your MySQL administrative login and password: + + ./mysqltuner.pl + +2. The script will return results similar to the output below: + + {{< output >}} >> MySQLTuner 1.4.0 - Major Hayden >> Bug reports, feature requests, and downloads at http://mysqltuner.com/ >> Run with '--help' for additional options and output filtering @@ -84,26 +93,26 @@ The [MySQLTuner](http://mysqltuner.com/) script assesses your MySQL installation Enable the slow query log to troubleshoot bad queries Variables to adjust: query_cache_limit (> 1M, or use smaller result sets) - + {{}} MySQLTuner offers suggestions regarding how to better the database's performance. If you are wary about updating your database on your own, following MySQLTuner's suggestions is one of the safer ways to improve your database performance. ## Tuning MySQL When altering the MySQL configuration, be alert to the changes and how they affect your database. Even when following the instructions of programs such as [MySQLTuner](#mysqltuner), it is best to have some understanding of the process. -The file you are changing is located at `/etc/mysql/my.cnf`. +The MySQL configuration file stored in the following location: `/etc/mysql/my.cnf`. {{< note >}} -Prior to updating the MySQL configuration, create a backup of the `my.cnf` file: +Prior to updating your MySQL configuration, create a backup of the `my.cnf` file: cp /etc/mysql/my.cnf ~/my.cnf.backup Best practice suggests that you make small changes, one at a time, and then monitor the server after each change. You should restart MySQL after each change: -For systems without systemd: +For distributions using systemd: systemctl restart mysqld -For distributions which don't use systemd: +For distributions with different init systems: service mysql restart