From 2db14831236f1d019ae79ab7c8e39d514afdc552 Mon Sep 17 00:00:00 2001 From: mhasbini Date: Sat, 11 Jun 2016 16:19:55 +0000 Subject: [PATCH 1/5] switch version check with mysql_setup --- mysqltuner.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mysqltuner.pl b/mysqltuner.pl index 4c2ebee..74ed736 100755 --- a/mysqltuner.pl +++ b/mysqltuner.pl @@ -4034,8 +4034,8 @@ sub which { # BEGIN 'MAIN' # --------------------------------------------------------------------------- headerprint; # Header Print -mysql_setup; # Gotta login first validate_tuner_version; # Check last version +mysql_setup; # Gotta login first os_setup; # Set up some OS variables get_all_vars; # Toss variables/status into hashes get_tuning_info; # Get information about the tuning connexion @@ -4049,7 +4049,7 @@ security_recommendations; # Display some security recommendations cve_recommendations; # Display related CVE calculations; # Calculate everything we need mysql_stats; # Print the server stats -mysqsl_pfs # Print Performance schema info +mysqsl_pfs; # Print Performance schema info mariadb_threadpool; # Print MaraiDB ThreadPool stats mysql_myisam; # Print MyISAM stats mariadb_ariadb; # Print MaraiDB AriaDB stats From d14809363477843903b074d1ef838838342494ae Mon Sep 17 00:00:00 2001 From: mhasbini Date: Sat, 11 Jun 2016 16:36:59 +0000 Subject: [PATCH 2/5] no need to return, just exit --- mysqltuner.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysqltuner.pl b/mysqltuner.pl index 74ed736..62c0cc1 100755 --- a/mysqltuner.pl +++ b/mysqltuner.pl @@ -593,7 +593,7 @@ sub compare_tuner_version { return; } goodprint "You have the latest version of MySQLTuner($tunerversion)"; - return; + exit 0; } # Checks to see if a MySQL login is possible From e4500742548f696f21fbc1764a56c14027dbbb77 Mon Sep 17 00:00:00 2001 From: Louis Sautier Date: Thu, 16 Jun 2016 10:33:03 +0200 Subject: [PATCH 3/5] Reword a message --- mysqltuner.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysqltuner.pl b/mysqltuner.pl index 62c0cc1..18e1855 100755 --- a/mysqltuner.pl +++ b/mysqltuner.pl @@ -2446,7 +2446,7 @@ sub mysql_stats { badprint "Overall possible memory usage with other process exceeded memory"; push( @generalrec, - "Dedicated this server to your database for highest performance." ); + "Dedicate this server to your database for highest performance." ); } else { goodprint From 2aece48996e854914ed642929c91e7e79f2540a1 Mon Sep 17 00:00:00 2001 From: Jean-Marie Renouard Date: Thu, 16 Jun 2016 11:00:36 +0200 Subject: [PATCH 4/5] Update README.md --- README.md | 38 +++++++++++++++++++++++++++++++------- 1 file changed, 31 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 58ba0c2..9509bb1 100644 --- a/README.md +++ b/README.md @@ -94,15 +94,15 @@ __Usage:__ Enable debugging information FAQ -- -Question: Will MySQLTuner fix my slow MySQL 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 about improvements that you can make after it completes. *Make sure you read the warning above prior to following any recommendations.* -Question: Can I fire my DBA now? +**Question: Can I fire my DBA now?** **MySQLTuner will not replace your DBA in any form or fashion.** If your DBA constantly takes your parking spot and steals your lunch from the fridge, then you may want to consider it - but that's your call. -Question: Why does MySQLTuner keep asking me the login credentials for MySQL over and over? +**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: @@ -112,7 +112,7 @@ The script will try its best to log in via any means possible. It will check fo 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 ? +**Question: Is there another way to secure credentials on latest MySQL and MariaDB distributions ?** You could use mysql_config_editor utilities. @@ -130,11 +130,11 @@ To get information about stored credentials, use the following command: password = ***** host = localhost -Question: What's minimum privileges needed by a specific mysqltuner user in database ? +**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 *.* FOR 'mysqltuner'@'localhost' identified by pwd1234; -Question: It's not working on my OS! What gives?! +**Question: It's not working on my OS! What gives?!** These kinds of things are bound to happen. Here are the details I need from you in order to research the problem thoroughly: @@ -145,11 +145,35 @@ These kinds of things are bound to happen. Here are the details I need from you * The full text of the error * A copy of SHOW VARIABLES and SHOW GLOBAL STATUS output (if possible) -Question: How to perform a CVE vulneralibity checks ? +**Question: How to perform a CVE vulneralibity checks ?** * Download vulnerabilities.csv from this repository. * use option --cvefile to perform CVE checks +**Question: How to use mysqltuner from remote host ?** + +* You will still have to connect like a mysql client: + +* Connection and Authentication + + --host Connect to a remote host to perform tests (default: localhost) + --socket Use a different socket for a local connection + --port Port to use for connection (default: 3306) + --user Username to use for authentication + --pass Password to use for authentication + +* Since you are using a remote host, use parameters to supply values from the OS + + --forcemem Amount of RAM installed in megabytes + --forceswap Amount of swap memory configured in megabytes + +* You may have to contact your remote SysAdmin to ask how much RAM and swap you have + +* If the database has too many tables, or very large table, use this: + + --skipsize Don't enumerate tables and their types/sizes (default: on) + (Recommended for servers with many tables) + MySQLTuner and Vagrant -- **MySQLTuner** contains following Vagrant configurations: From 8e831cf09d8d95d9dad2ae3886c6a280afe3a751 Mon Sep 17 00:00:00 2001 From: Jean-Marie Renouard Date: Thu, 16 Jun 2016 11:01:55 +0200 Subject: [PATCH 5/5] Update README.md --- README.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 9509bb1..578e76c 100644 --- a/README.md +++ b/README.md @@ -156,15 +156,20 @@ These kinds of things are bound to happen. Here are the details I need from you * Connection and Authentication - --host Connect to a remote host to perform tests (default: localhost) + --host Connect to a remote host to perform tests (default: localhost) + --socket Use a different socket for a local connection + --port Port to use for connection (default: 3306) + --user Username to use for authentication + --pass Password to use for authentication * Since you are using a remote host, use parameters to supply values from the OS --forcemem Amount of RAM installed in megabytes + --forceswap Amount of swap memory configured in megabytes * You may have to contact your remote SysAdmin to ask how much RAM and swap you have