From f6f54c563fa0b613ad683e0516884f883be7cd43 Mon Sep 17 00:00:00 2001 From: AlberT Date: Tue, 18 Oct 2016 11:22:59 +0200 Subject: [PATCH 01/12] Create README.it.md Initial release .. just a copy of the original english file --- README.it.md | 236 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 236 insertions(+) create mode 100644 README.it.md diff --git a/README.it.md b/README.it.md new file mode 100644 index 0000000..bff914e --- /dev/null +++ b/README.it.md @@ -0,0 +1,236 @@ +MySQLTuner-perl +==== +[![Build Status - Master](https://travis-ci.org/major/MySQLTuner-perl.svg?branch=master)](https://travis-ci.org/major/MySQLTuner-perl) +[![Project Status](http://opensource.box.com/badges/active.svg)](http://opensource.box.com/badges) +[![Project Status](http://opensource.box.com/badges/maintenance.svg)](http://opensource.box.com/badges) +[![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 issues still open](http://isitmaintained.com/badge/open/major/MySQLTuner-perl.svg)](http://isitmaintained.com/project/major/MySQLTuner-perl "Percentage of issues still open") +[![GPL Licence](https://badges.frapsoft.com/os/gpl/gpl.png?v=103)](https://opensource.org/licenses/GPL-3.0/) + +**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 in this last version ~250 indicators for MySQL/MariaDB/Percona Server. + +**MySQLTuner** is maintained and indicator collect is increasing week after week supporting a lot of configuration sush 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 found more details on this indicators +![Indicators description](https://github.com/major/MySQLTuner-perl/blob/master/INTERNALS.md). + + +![MysqlTuner](https://github.com/major/MySQLTuner-perl/blob/master/mysqltuner.png) + +MySQLTuner needs you: +=== + +**MySQLTuner** needs contributors for documentation, code and feedbacks.. + +* Please join us on issue track at [GitHub tracker](https://github.com/major/MySQLTuner-perl/issues). +* Contribution guide is avalaible following [MySQLTuner contributing guide](https://github.com/major/MySQLTuner-perl/blob/master/CONTRIBUTING.md) +* Star **MySQLTuner project** at [MySQLTuner Git Hub Project](https://github.com/major/MySQLTuner-perl) + +Compatibility: +==== + +* MySQL 5.7 (full support) +* MySQL 5.6 (full support) +* MySQL 5.5 (full support) +* MariaDB 10.1 (full support) +* MariaDB 10.0 (full support) +* Percona Server 5.6 (full support) +* Percona XtraDB cluster (full support) +* MySQL 3.23, 4.0, 4.1, 5.0, 5.1 (partial support - deprecated version) +* Perl 5.6 or later (with [perl-doc](http://search.cpan.org/~dapm/perl-5.14.4/pod/perldoc.pod) package) +* Unix/Linux based operating system (tested on Linux, BSD variants, and Solaris variants) +* Windows is not supported at this time (Help wanted !!!!!) +* Unrestricted read access to the MySQL server (OS root access recommended for MySQL < 5.1) +* CVE vulnerabilites detection support from [https://cve.mitre.org](https://cve.mitre.org) + +***WARNING*** +-- +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. + +**Seriously - please review the FAQ section below.** + +What MySQLTuner is checking exactly ? +-- +All checks done by **MySQLTuner** are documented in [MySQLTuner Internals](https://github.com/major/MySQLTuner-perl/blob/master/INTERNALS.md) documentation. + +Download/Installation +-- + +You can download the entire repository by using 'git clone' followed by the cloning URL above. The simplest and shortest method is: + + wget http://mysqltuner.pl/ -O mysqltuner.pl + wget https://raw.githubusercontent.com/major/MySQLTuner-perl/master/basic_passwords.txt -O basic_passwords.txt + wget https://raw.githubusercontent.com/major/MySQLTuner-perl/master/vulnerabilities.csv -O vulnerabilities.csv + perl mysqltuner.pl + +Of course, you can add the execute bit (`chmod +x mysqltuner.pl`) so you can execute it without calling perl directly. + +Specific usage +-- + +__Usage:__ Minimal usage locally + + perl mysqltuner.pl + +__Usage:__ Minimal usage remotely + + perl mysqltuner.pl --host targetDNS_IP --user admin_user --pass admin_password + +__Usage:__ Enable maximum output information around MySQL/MariaDb without debugging + + perl mysqltuner.pl --verbose + perl mysqltuner.pl --buffers --dbstat --idxstat --sysstat --pfstat + + +__Usage:__ Enable CVE vulnerabilities check for your MariaDB or MySQL version + + perl mysqltuner.pl --cvefile=vulnerabilities.csv + +__Usage:__ Write your result in a file with information displayed + + perl mysqltuner.pl --outputfile /tmp/result_mysqltuner.txt + +__Usage:__ Write your result in a file **without outputting information** + + perl mysqltuner.pl --silent --outputfile /tmp/result_mysqltuner.txt + +__Usage:__ Using template model to customize your reporting file based on [Text::Template](https://metacpan.org/pod/Text::Template) syntax. + + perl mysqltuner.pl --silent --reportfile /tmp/result_mysqltuner.txt --template=/tmp/mymodel.tmpl + +__Usage:__ Enable debugging information + + perl mysqltuner.pl --debug + +FAQ +-- + +**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?** + +**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?** + +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 + pass=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. + + $ mysql_config_editor set --login-path=client --user=someusername --password --host=localhost + Enter passord: ******** + $ + +At this time, ~/.mylogin.cnf has been written with appropriated rigth 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 *.* FOR 'mysqltuner'@'localhost' identified by pwd1234; + +**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: + +* OS and OS version +* Architecture (x86, x86_64, IA64, Commodore 64) +* Exact MySQL version +* Where you obtained your MySQL version (OS package, source, etc) +* 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 ?** + +* Download vulnerabilities.csv from this repository. +* use option --cvefile to perform CVE checks + +**Question: How to use mysqltuner from remote host ?** +Thanks to [@rolandomysqldba](http://dba.stackexchange.com/users/877/rolandomysqldba) + +* 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 + --defaults-file defaulfs file for credentials + +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: +* Fedora Core 23 / MariaDB 10.0 +* Fedora Core 23 / MariaDB 10.1 +* Fedora Core 23 / MySQL 5.6 +* Fedora Core 23 / MySQL 5.7 + +**Vagrant File** are stored in Vagrant subdirectory. +* Follow this 2 steps after vagrant installation: +* Rename VagrantFile_for_Mxxx into Vagrantfile +* vagrant up + +**MySQLTuner** contains a Vagrant configurations for test purpose and development +* Install VirtualBox and Vagrant + * https://www.virtualbox.org/wiki/Downloads + * https://www.vagrantup.com/downloads.html +* Clone repository + * git clone https://github.com/major/MySQLTuner-perl.git +* Install Vagrant plugins vagrant-hostmanager and vagrant-vbguest + * vagrant plugin install vagrant-hostmanager + * vagrant plugin install vagrant-vbguest +* Add Fedora Core 23 box for official Fedora Download Website + * vagrant box add --name fc23 https://download.fedoraproject.org/pub/fedora/linux/releases/23/Cloud/x86_64/Images/Fedora-Cloud-Base-Vagrant-23-20151030.x86_64.vagrant-virtualbox.box +* Create a data directory + * mkdir data +* Rename Vagrantfile_MariaDB10.0 into Vagrantfile + * cp MySQLTuner-perl/Vagrant/Vagrantfile_for_MariaDB10.0 Vagrantfile +* Start vagrant + * vagrant up + +MySQLTuner needs you +-- +**MySQLTuner** needs contributors for documentation, code and feedbacks.. + +* Please join us on issue track at [GitHub tracker](https://github.com/major/MySQLTuner-perl/issues). +* Contribution guide is avalaible following [MySQLTuner contributing guide](https://github.com/major/MySQLTuner-perl/blob/master/CONTRIBUTING.md) +* Star **MySQLTuner project** at [MySQLTuner Git Hub Project](https://github.com/major/MySQLTuner-perl) + From 29a78a1200386abd8b139e59ab6adf1a241ed106 Mon Sep 17 00:00:00 2001 From: drAlberT Date: Tue, 18 Oct 2016 13:07:00 +0200 Subject: [PATCH 02/12] Translated up to FAQ (excluded) removed trailing spaces too --- README.it.md | 100 +++++++++++++++++++++++++-------------------------- 1 file changed, 48 insertions(+), 52 deletions(-) diff --git a/README.it.md b/README.it.md index bff914e..87efb00 100644 --- a/README.it.md +++ b/README.it.md @@ -1,63 +1,59 @@ MySQLTuner-perl ==== -[![Build Status - Master](https://travis-ci.org/major/MySQLTuner-perl.svg?branch=master)](https://travis-ci.org/major/MySQLTuner-perl) -[![Project Status](http://opensource.box.com/badges/active.svg)](http://opensource.box.com/badges) -[![Project Status](http://opensource.box.com/badges/maintenance.svg)](http://opensource.box.com/badges) -[![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 issues still open](http://isitmaintained.com/badge/open/major/MySQLTuner-perl.svg)](http://isitmaintained.com/project/major/MySQLTuner-perl "Percentage of issues still open") -[![GPL Licence](https://badges.frapsoft.com/os/gpl/gpl.png?v=103)](https://opensource.org/licenses/GPL-3.0/) +[![Stato della build - Master](https://travis-ci.org/major/MySQLTuner-perl.svg?branch=master)](https://travis-ci.org/major/MySQLTuner-perl) +[![Stato del progetto](http://opensource.box.com/badges/active.svg)](http://opensource.box.com/badges) +[![Stato del progetto](http://opensource.box.com/badges/maintenance.svg)](http://opensource.box.com/badges) +[![Tempo medio per la soluzione di problemi](http://isitmaintained.com/badge/resolution/major/MySQLTuner-perl.svg)](http://isitmaintained.com/project/major/MySQLTuner-perl "Average time to resolve an issue") +[![Percentuale di problemi non risolti](http://isitmaintained.com/badge/open/major/MySQLTuner-perl.svg)](http://isitmaintained.com/project/major/MySQLTuner-perl "Percentage of issues still open") +[![Licenza GPL](https://badges.frapsoft.com/os/gpl/gpl.png?v=103)](https://opensource.org/licenses/GPL-3.0/) -**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** è uno script Perl che permette di analizzare velocemente una installazione di MySQL, nonché di apportare modifiche per migliorare le prestazioni e la stabilità. In modo coinciso sono riportati lo stato attuale delle variabili di configurazione e i dati sullo stato del sistema, corredati da suggerimenti di base per il miglioramento delle prestazioni. -**MySQLTuner** supports in this last version ~250 indicators for MySQL/MariaDB/Percona Server. +**MySQLTuner** supporta, in quest'ultima versione, circa 250 indicatori per i server MySQL/MariaDB/Percona. -**MySQLTuner** is maintained and indicator collect is increasing week after week supporting a lot of configuration sush 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/), ... +**MySQLTuner** è attivamente manutenuto e nuovi indicatori sono aggiunti di settimana in settimana, supportando un gran numero di configurazioni tra le quali ![Galera Cluster](http://galeracluster.com/), ![TokuDB](https://www.percona.com/software/mysql-database/percona-tokudb), ![ Performance schema](https://github.com/mysql/mysql-sys), metriche relative al SO Linux, ![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 found more details on this indicators +Maggiori dettagli sugli indicatori ![Indicators description](https://github.com/major/MySQLTuner-perl/blob/master/INTERNALS.md). ![MysqlTuner](https://github.com/major/MySQLTuner-perl/blob/master/mysqltuner.png) -MySQLTuner needs you: +MySQLTuner ha bisogno di te: === -**MySQLTuner** needs contributors for documentation, code and feedbacks.. +**MySQLTuner** ha bisogno di collaboratori per la documentazione, il codice e suggerimenti.. -* Please join us on issue track at [GitHub tracker](https://github.com/major/MySQLTuner-perl/issues). -* Contribution guide is avalaible following [MySQLTuner contributing guide](https://github.com/major/MySQLTuner-perl/blob/master/CONTRIBUTING.md) -* Star **MySQLTuner project** at [MySQLTuner Git Hub Project](https://github.com/major/MySQLTuner-perl) - -Compatibility: +* Problemi e suggerimenti possono essere riportati su [GitHub tracker](https://github.com/major/MySQLTuner-perl/issues). +* La guida per contribuire è disponibile in inglese: [MySQLTuner contributing guide](https://github.com/major/MySQLTuner-perl/blob/master/CONTRIBUTING.md) +* Dai un Stella a **MySQLTuner project** su [GitHub](https://github.com/major/MySQLTuner-perl) + +Compatibilità: ==== -* MySQL 5.7 (full support) -* MySQL 5.6 (full support) -* MySQL 5.5 (full support) -* MariaDB 10.1 (full support) -* MariaDB 10.0 (full support) -* Percona Server 5.6 (full support) -* Percona XtraDB cluster (full support) -* MySQL 3.23, 4.0, 4.1, 5.0, 5.1 (partial support - deprecated version) -* Perl 5.6 or later (with [perl-doc](http://search.cpan.org/~dapm/perl-5.14.4/pod/perldoc.pod) package) -* Unix/Linux based operating system (tested on Linux, BSD variants, and Solaris variants) -* Windows is not supported at this time (Help wanted !!!!!) -* Unrestricted read access to the MySQL server (OS root access recommended for MySQL < 5.1) -* CVE vulnerabilites detection support from [https://cve.mitre.org](https://cve.mitre.org) +* MySQL 5.7 (pieno supporto) +* MySQL 5.6 (pieno supporto) +* MySQL 5.5 (pieno supporto) +* MariaDB 10.1 (pieno supporto) +* MariaDB 10.0 (pieno supporto) +* Percona Server 5.6 (pieno supporto) +* Percona XtraDB cluster (pieno supporto) +* MySQL 3.23, 4.0, 4.1, 5.0, 5.1 (supporto parziale - versione deprecata) +* Perl 5.6 o successivi (col pacchetto [perl-doc](http://search.cpan.org/~dapm/perl-5.14.4/pod/perldoc.pod)) +* Sistemi operativi basati su Unix/Linux (testato su Linux, varianti di BSD e di Solaris) +* Windows non è supportato al momento (gradito aiuto!!!!!) +* Accesso completo in lettura al server MySQL (accesso root a livello di SO raccomandato per MySQL < 5.1) +* supporto al rilevamento di vulnerabilità CVE da [https://cve.mitre.org](https://cve.mitre.org) -***WARNING*** +***ATTENZIONE*** -- -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. +È **estremamente importante** che tu capisca appieno ogni singola modifica apportata alla configurazione del server MySQL. +Qualora non capissi appieno qualche parte dell'output dello script o se non capissi quanto raccomandato **dovresti consultare** un DBA esperto o un amministratore di sistema di cui hai fiducia. +Testa **sempre** le modifiche su ambienti ad hoc e tieni sempre presente che miglioramenti in un settore potrebbero **influenzare negativamente** MySQL in altri settori. -**Seriously - please review the FAQ section below.** +**Seriamente - consulta la sezione FAQ che segue.** -What MySQLTuner is checking exactly ? +What MySQLTuner is checking exactly ? -- All checks done by **MySQLTuner** are documented in [MySQLTuner Internals](https://github.com/major/MySQLTuner-perl/blob/master/INTERNALS.md) documentation. @@ -70,7 +66,7 @@ You can download the entire repository by using 'git clone' followed by the clon wget https://raw.githubusercontent.com/major/MySQLTuner-perl/master/basic_passwords.txt -O basic_passwords.txt wget https://raw.githubusercontent.com/major/MySQLTuner-perl/master/vulnerabilities.csv -O vulnerabilities.csv perl mysqltuner.pl - + Of course, you can add the execute bit (`chmod +x mysqltuner.pl`) so you can execute it without calling perl directly. Specific usage @@ -78,27 +74,27 @@ Specific usage __Usage:__ Minimal usage locally - perl mysqltuner.pl + perl mysqltuner.pl __Usage:__ Minimal usage remotely perl mysqltuner.pl --host targetDNS_IP --user admin_user --pass admin_password -__Usage:__ Enable maximum output information around MySQL/MariaDb without debugging +__Usage:__ Enable maximum output information around MySQL/MariaDb without debugging perl mysqltuner.pl --verbose perl mysqltuner.pl --buffers --dbstat --idxstat --sysstat --pfstat - + __Usage:__ Enable CVE vulnerabilities check for your MariaDB or MySQL version perl mysqltuner.pl --cvefile=vulnerabilities.csv -__Usage:__ Write your result in a file with information displayed +__Usage:__ Write your result in a file with information displayed perl mysqltuner.pl --outputfile /tmp/result_mysqltuner.txt -__Usage:__ Write your result in a file **without outputting information** +__Usage:__ Write your result in a file **without outputting information** perl mysqltuner.pl --silent --outputfile /tmp/result_mysqltuner.txt @@ -106,7 +102,7 @@ __Usage:__ Using template model to customize your reporting file based on [Text: perl mysqltuner.pl --silent --reportfile /tmp/result_mysqltuner.txt --template=/tmp/mymodel.tmpl -__Usage:__ Enable debugging information +__Usage:__ Enable debugging information perl mysqltuner.pl --debug @@ -128,7 +124,7 @@ The script will try its best to log in via any means possible. It will check fo [client] user=someusername pass=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 ?** @@ -179,7 +175,7 @@ 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 + --user Username to use for authentication --pass Password to use for authentication --defaults-file defaulfs file for credentials @@ -202,8 +198,8 @@ MySQLTuner and Vagrant * Fedora Core 23 / MariaDB 10.1 * Fedora Core 23 / MySQL 5.6 * Fedora Core 23 / MySQL 5.7 - -**Vagrant File** are stored in Vagrant subdirectory. + +**Vagrant File** are stored in Vagrant subdirectory. * Follow this 2 steps after vagrant installation: * Rename VagrantFile_for_Mxxx into Vagrantfile * vagrant up @@ -233,4 +229,4 @@ MySQLTuner needs you * Please join us on issue track at [GitHub tracker](https://github.com/major/MySQLTuner-perl/issues). * Contribution guide is avalaible following [MySQLTuner contributing guide](https://github.com/major/MySQLTuner-perl/blob/master/CONTRIBUTING.md) * Star **MySQLTuner project** at [MySQLTuner Git Hub Project](https://github.com/major/MySQLTuner-perl) - + From 7a37e62cd19df9799842bacde9894563ab300af5 Mon Sep 17 00:00:00 2001 From: drAlberT Date: Tue, 18 Oct 2016 16:29:49 +0200 Subject: [PATCH 03/12] Italian translation finished --- README.it.md | 163 +++++++++++++++++++++++++++------------------------ 1 file changed, 85 insertions(+), 78 deletions(-) diff --git a/README.it.md b/README.it.md index 87efb00..c6c7d8d 100644 --- a/README.it.md +++ b/README.it.md @@ -22,7 +22,7 @@ Maggiori dettagli sugli indicatori MySQLTuner ha bisogno di te: === -**MySQLTuner** ha bisogno di collaboratori per la documentazione, il codice e suggerimenti.. +**MySQLTuner** ha bisogno di collaboratori per documentazione, codice e suggerimenti .. * Problemi e suggerimenti possono essere riportati su [GitHub tracker](https://github.com/major/MySQLTuner-perl/issues). * La guida per contribuire è disponibile in inglese: [MySQLTuner contributing guide](https://github.com/major/MySQLTuner-perl/blob/master/CONTRIBUTING.md) @@ -53,91 +53,95 @@ Testa **sempre** le modifiche su ambienti ad hoc e tieni sempre presente che mig **Seriamente - consulta la sezione FAQ che segue.** -What MySQLTuner is checking exactly ? +Cosa verifica esattamente MySQLTuner ? -- -All checks done by **MySQLTuner** are documented in [MySQLTuner Internals](https://github.com/major/MySQLTuner-perl/blob/master/INTERNALS.md) documentation. +Tutti i controlli effettuati da **MySQLTuner** sono documentati in [MySQLTuner Internals](https://github.com/major/MySQLTuner-perl/blob/master/INTERNALS.md). -Download/Installation +Download/Installazione -- -You can download the entire repository by using 'git clone' followed by the cloning URL above. The simplest and shortest method is: +Si può semplicemente scaricare l'intero codice utilizzando `git clone` seguito dalla URL riportata sopra. +Il modo più semplice è il seguente: wget http://mysqltuner.pl/ -O mysqltuner.pl wget https://raw.githubusercontent.com/major/MySQLTuner-perl/master/basic_passwords.txt -O basic_passwords.txt wget https://raw.githubusercontent.com/major/MySQLTuner-perl/master/vulnerabilities.csv -O vulnerabilities.csv perl mysqltuner.pl -Of course, you can add the execute bit (`chmod +x mysqltuner.pl`) so you can execute it without calling perl directly. +Ovviamente è possibile assegnare il permesso di esecuzione in modo da poter lanciare il comando senza chiamare l'interprete `perl` (`chmod +x mysqltuner.pl`). -Specific usage +Casi d'uso -- -__Usage:__ Minimal usage locally +__Uso:__ Minimale locale perl mysqltuner.pl -__Usage:__ Minimal usage remotely +__Uso:__ Minimale da remoto perl mysqltuner.pl --host targetDNS_IP --user admin_user --pass admin_password -__Usage:__ Enable maximum output information around MySQL/MariaDb without debugging +__Uso:__ Abilitando il massimo livello di informazione in output su MySQL/MariaDb senza usare l'optione di debug perl mysqltuner.pl --verbose perl mysqltuner.pl --buffers --dbstat --idxstat --sysstat --pfstat -__Usage:__ Enable CVE vulnerabilities check for your MariaDB or MySQL version +__Uso:__ Abilitando la verifica delle vulnerabilità CVE per la versione di MariaDB o MySQL installata perl mysqltuner.pl --cvefile=vulnerabilities.csv -__Usage:__ Write your result in a file with information displayed +__Uso:__ Salvando i risultati su un file con le stesse informazione mostrate a video perl mysqltuner.pl --outputfile /tmp/result_mysqltuner.txt -__Usage:__ Write your result in a file **without outputting information** +__Uso:__ Salvando i risultati su un file **senza mostrare nulla a video** perl mysqltuner.pl --silent --outputfile /tmp/result_mysqltuner.txt -__Usage:__ Using template model to customize your reporting file based on [Text::Template](https://metacpan.org/pod/Text::Template) syntax. +__Uso:__ Utilizzando un modello per personalizzare il file di output, con la sintassi di [Text::Template](https://metacpan.org/pod/Text::Template). perl mysqltuner.pl --silent --reportfile /tmp/result_mysqltuner.txt --template=/tmp/mymodel.tmpl -__Usage:__ Enable debugging information +__Uso:__ Abilitando la modalità di debug perl mysqltuner.pl --debug FAQ -- -**Question: Will MySQLTuner fix my slow MySQL server?** +**Domanda: MySQLTuner sistemerà il mio server MySQL lento?** -**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.* +**No.** MySQLTuner è uno script che legge solamente. Non scriverà alcun file di configurazione, non modificherà lo stato di alcun demone né chiamerà tua madre per augurarle buon compleanno. +Ti darà una panoramica delle prestazioni del tuo server, facendo alcune raccomandazioni basilari circa i miglioramenti che tu puoi apportare. *assicurati di leggere l'avviso precedente prima di seguire qualsiasi raccomandazione.* -**Question: Can I fire my DBA now?** +**Domanda: Posso eliminare il mio DBA ora?** -**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. +**MySQLTuner non sostituirà il tuo DBA in alcun modo.** Se il tuo DBA continuamente occupa il tuo parcheggio e ruba il tuo cibo dal frigo puoi considerare l'opzione - ma resta una tua scelta. -**Question: Why does MySQLTuner keep asking me the login credentials for MySQL over and over?** +**Domanda: Perché MySQLTuner continua a chiedermi ogni volta le credenziali di login di MySQL?** -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: +Lo script cerca di arguirle in ogni modo possibile. Cercando file `~/.my.cnf`, file di password di Plesk e provando il login di root con password vuota. +Se nessuno di questi modi ha successo, allora la password viene richiesta. Se preferisci che lo script giri in modo automatico, senza interazione con l'utente, allora crea un file `.my.cnf` nella tua cartella home che contenga: [client] user=someusername pass=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. +Una volta creato, assicurati che tu sia il proprietario (owner) e che i permessi siano 0600. Questo dovrebbe preservare le tue credenziali di login per i database da occhi indiscreti, in condizioni normali. +Se un [Terminator modello T-1000 apparisse vestito da Carabiniere](https://it.wikipedia.org/wiki/T-1000) e chiedesse le tue credenziali non avresti poi tante scelte. -**Question: Is there another way to secure credentials on latest MySQL and MariaDB distributions ?** +**Domanda: C'è qualche altro modo per rendere sicure le credenziali sulle ultime versioni di MySQL e MariaDB ?** -You could use mysql_config_editor utilities. +Potresti utilizzare il comando `mysql_config_editor`. $ mysql_config_editor set --login-path=client --user=someusername --password --host=localhost Enter passord: ******** $ -At this time, ~/.mylogin.cnf has been written with appropriated rigth access. +Che crea il file `~/.mylogin.cnf` con i prmessi di accesso appropriati. -To get information about stored credentials, use the following command: +Per avere informazioni sulle credenziali salvate, si usi ilseguente comando: $mysql_config_editor print [client] @@ -145,88 +149,91 @@ 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 ?** +**Domanda: Quali sono i privilegi minimi, nel database, necessari per un utente *mysqltuner* ad hoc ?** 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?!** +**Domanda: Non funziona sul mio SO! Che succede?!** -These kinds of things are bound to happen. Here are the details I need from you in order to research the problem thoroughly: +Questo genere di cose sono destinate ad accadere. Ecco i dettagli di cui ho bisogno per indagare sul problema: -* OS and OS version -* Architecture (x86, x86_64, IA64, Commodore 64) -* Exact MySQL version -* Where you obtained your MySQL version (OS package, source, etc) -* The full text of the error -* A copy of SHOW VARIABLES and SHOW GLOBAL STATUS output (if possible) +* SO e versione del SO +* Architettura (x86, x86_64, IA64, Commodore 64) +* Versione esatta di MySQL +* Da dove viene la tua versione di MySQL (pacchetto del SO, sorgenti, etc.) +* Il testo completo dell'errore +* L'output dei comandi `SHOW VARIABLES;` e `SHOW GLOBAL STATUS;`(se possibile) -**Question: How to perform a CVE vulneralibity checks ?** +**Domanda: How to perform a CVE vulneralibity checks ?** +**Domanda: Come eseguo il check per le vulnerabilità CVE ?** -* Download vulnerabilities.csv from this repository. -* use option --cvefile to perform CVE checks +* Scarica il file `vulnerabilities.csv`da questo repository. +* Usa l'opzione `--cvefile` per eseguire i test delle CVE -**Question: How to use mysqltuner from remote host ?** -Thanks to [@rolandomysqldba](http://dba.stackexchange.com/users/877/rolandomysqldba) +**Domanda: Come uso mysqltuner da un altro computer ?** +Grazie a [@rolandomysqldba](http://dba.stackexchange.com/users/877/rolandomysqldba) * You will still have to connect like a mysql client: +* Ti dovrai collegare come un client mysql: -Connection and Authentication +Connessione e Autenticazione - --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 - --defaults-file defaulfs file for credentials + --host Si connette a un host remoto per eseguire i test (default: localhost) + --socket Usa un socket per effettuare una connessione locale + --port Porta per la connessione (default: 3306) + --user Username per l'autenticazione + --pass Password per l'autenticazione + --defaults-file defaults file per le credenziali -Since you are using a remote host, use parameters to supply values from the OS +Poiché si sta utilizzando un host remoto, si utilizzino i seguenti parametri per fornire allo script i valori del SO - --forcemem Amount of RAM installed in megabytes - --forceswap Amount of swap memory configured in megabytes + --forcemem Valore della RAM installata, in megabyte + --forceswap Valore della memoria di swap configurata, in megabyte -* You may have to contact your remote SysAdmin to ask how much RAM and swap you have +* Potresti dover contattare il sistemista del server remoto per conoscere i valori di RAM e swap -If the database has too many tables, or very large table, use this: +Se il database ha troppe tabelle, o tabelle veramente grandi, si usi: - --skipsize Don't enumerate tables and their types/sizes (default: on) - (Recommended for servers with many tables) + --skipsize Non elenca le tabelle ed i rispettivi tipi e dimensioni (default: on) + (Raccomandato per server con molte tabelle) -MySQLTuner and Vagrant +MySQLTuner e Vagrant -- -**MySQLTuner** contains following Vagrant configurations: +**MySQLTuner** contiene le seguenti configurazioni per Vagrant: * Fedora Core 23 / MariaDB 10.0 * Fedora Core 23 / MariaDB 10.1 * Fedora Core 23 / MySQL 5.6 * Fedora Core 23 / MySQL 5.7 -**Vagrant File** are stored in Vagrant subdirectory. -* Follow this 2 steps after vagrant installation: -* Rename VagrantFile_for_Mxxx into Vagrantfile -* vagrant up +**Vagrant File** sono collocati nella sotto-directory di Vagrant. +* Segui questi due passaggi dopo l'installazione di Vagrant: + * Rinominare `VagrantFile_for_Mxxx` in `Vagrantfile` + * `vagrant up` -**MySQLTuner** contains a Vagrant configurations for test purpose and development -* Install VirtualBox and Vagrant +**MySQLTuner** contiene una configurazione Vagrant a scopo di test e sviluppo +* Installare VirtualBox e Vagrant * https://www.virtualbox.org/wiki/Downloads * https://www.vagrantup.com/downloads.html -* Clone repository +* Clone del repository * git clone https://github.com/major/MySQLTuner-perl.git -* Install Vagrant plugins vagrant-hostmanager and vagrant-vbguest - * vagrant plugin install vagrant-hostmanager - * vagrant plugin install vagrant-vbguest -* Add Fedora Core 23 box for official Fedora Download Website - * vagrant box add --name fc23 https://download.fedoraproject.org/pub/fedora/linux/releases/23/Cloud/x86_64/Images/Fedora-Cloud-Base-Vagrant-23-20151030.x86_64.vagrant-virtualbox.box -* Create a data directory - * mkdir data -* Rename Vagrantfile_MariaDB10.0 into Vagrantfile - * cp MySQLTuner-perl/Vagrant/Vagrantfile_for_MariaDB10.0 Vagrantfile +* Installare i plugin di Vagrant `vagrant-hostmanager` e `vagrant-vbguest` + * `vagrant plugin install vagrant-hostmanager` + * `vagrant plugin install vagrant-vbguest` +* Aggiungere un box Fedora Core 23 dal sito ufficiale di Fedora + * `vagrant box add --name fc23 https://download.fedoraproject.org/pub/fedora/linux/releases/23/Cloud/x86_64/Images/Fedora-Cloud-Base-Vagrant-23-20151030.x86_64.vagrant-virtualbox.box` +* Creare una directory `data` + * `mkdir data` +* Rinominare `Vagrantfile_MariaDB10.0` in `Vagrantfile` + * `cp MySQLTuner-perl/Vagrant/Vagrantfile_for_MariaDB10.0 Vagrantfile` * Start vagrant - * vagrant up + * `vagrant up` -MySQLTuner needs you +MySQLTuner ha bisogno di te: -- -**MySQLTuner** needs contributors for documentation, code and feedbacks.. -* Please join us on issue track at [GitHub tracker](https://github.com/major/MySQLTuner-perl/issues). -* Contribution guide is avalaible following [MySQLTuner contributing guide](https://github.com/major/MySQLTuner-perl/blob/master/CONTRIBUTING.md) -* Star **MySQLTuner project** at [MySQLTuner Git Hub Project](https://github.com/major/MySQLTuner-perl) +**MySQLTuner** ha bisogno di collaboratori per documentazione, codice e suggerimenti .. + +* Problemi e suggerimenti possono essere riportati su [GitHub tracker](https://github.com/major/MySQLTuner-perl/issues). +* La guida per contribuire è disponibile in inglese: [MySQLTuner contributing guide](https://github.com/major/MySQLTuner-perl/blob/master/CONTRIBUTING.md) +* Dai un Stella a **MySQLTuner project** su [GitHub](https://github.com/major/MySQLTuner-perl) From 177f8bb7888e46100c41dd74c30c62c6f721661b Mon Sep 17 00:00:00 2001 From: AlberT Date: Tue, 18 Oct 2016 16:31:47 +0200 Subject: [PATCH 04/12] Fix misprint --- README.it.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.it.md b/README.it.md index c6c7d8d..fd544ae 100644 --- a/README.it.md +++ b/README.it.md @@ -164,7 +164,6 @@ Questo genere di cose sono destinate ad accadere. Ecco i dettagli di cui ho biso * Il testo completo dell'errore * L'output dei comandi `SHOW VARIABLES;` e `SHOW GLOBAL STATUS;`(se possibile) -**Domanda: How to perform a CVE vulneralibity checks ?** **Domanda: Come eseguo il check per le vulnerabilità CVE ?** * Scarica il file `vulnerabilities.csv`da questo repository. From 7b3f2ce9a9738cc29083b7377fd0a9c4e459f90f Mon Sep 17 00:00:00 2001 From: Karl Chen Date: Sun, 23 Oct 2016 13:42:01 +0800 Subject: [PATCH 05/12] Something wrong to print --- mysqltuner.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysqltuner.pl b/mysqltuner.pl index f3eeff3..1628469 100755 --- a/mysqltuner.pl +++ b/mysqltuner.pl @@ -4555,7 +4555,7 @@ sub mysql_innodb { . hr_bytes_rnd( $myvar{'innodb_buffer_pool_size'}/4 ) . ") if possible." ); } else { goodprint "InnoDB log file size / InnoDb Buffer pool size: " - . hr_bytes( $myvar{'innodb_buffer_pool_size'} ) . "/" + . hr_bytes( $myvar{'innodb_log_file_size'} ) . "/" . hr_bytes( $myvar{'innodb_buffer_pool_size'} ) . " should be equal 25%"; } # InnoDB Buffer Pull Instances (MySQL 5.6.6+) From 301e5f2291fa80d7237b436778b9090dcef3681a Mon Sep 17 00:00:00 2001 From: Karl Chen Date: Mon, 24 Oct 2016 00:32:48 +0800 Subject: [PATCH 06/12] Non importance changes --- mysqltuner.pl | 78 +++++++++++++++++++++++++-------------------------- 1 file changed, 38 insertions(+), 40 deletions(-) diff --git a/mysqltuner.pl b/mysqltuner.pl index 1628469..29f5822 100755 --- a/mysqltuner.pl +++ b/mysqltuner.pl @@ -2868,7 +2868,7 @@ sub mysql_stats { . $myvar{'open_files_limit'} . ") variable " ); push( @generalrec, - "should be greater than $table_cache_var ( " + "should be greater than $table_cache_var (" . $myvar{$table_cache_var} . ")" ); } @@ -2919,25 +2919,23 @@ sub mysql_stats { if ( $mycalc{'pct_binlog_cache'} < 90 && $mystat{'Binlog_cache_use'} > 0 ) { badprint "Binlog cache memory access: " - . $mycalc{'pct_binlog_cache'} . "% ( " - . ( - $mystat{'Binlog_cache_use'} - $mystat{'Binlog_cache_disk_use'} ) + . $mycalc{'pct_binlog_cache'} . "% (" + . ( $mystat{'Binlog_cache_use'} - $mystat{'Binlog_cache_disk_use'} ) . " Memory / " . $mystat{'Binlog_cache_use'} . " Total)"; push( @generalrec, "Increase binlog_cache_size (Actual value: " . $myvar{'binlog_cache_size'} - . ") " ); + . ")" ); push( @adjvars, "binlog_cache_size (" . hr_bytes( $myvar{'binlog_cache_size'} + 16 * 1024 * 1024 ) - . " ) " ); + . ")" ); } else { goodprint "Binlog cache memory access: " - . $mycalc{'pct_binlog_cache'} . "% ( " - . ( - $mystat{'Binlog_cache_use'} - $mystat{'Binlog_cache_disk_use'} ) + . $mycalc{'pct_binlog_cache'} . "% (" + . ( $mystat{'Binlog_cache_use'} - $mystat{'Binlog_cache_disk_use'} ) . " Memory / " . $mystat{'Binlog_cache_use'} . " Total)"; @@ -3661,7 +3659,7 @@ sub mysqsl_pfs { # TOP 15 high read latency index subheaderprint "Performance schema: TOP 15 high read latency index"; $nbL=1; - for my $lQuery(select_array ('use sys;select table_schema, table_name,index_name, select_latency from schema_index_statistics ORDER BY select_latency DESC LIMIT 15;')) { + for my $lQuery(select_array ('use sys;select table_schema, table_name,index_name, select_latency from schema_index_statistics ORDER BY select_latency DESC LIMIT 15;')) { infoprint " +-- $nbL: $lQuery"; $nbL++; } @@ -3670,7 +3668,7 @@ sub mysqsl_pfs { # TOP 15 high insert latency index subheaderprint "Performance schema: TOP 15 most modified indexes"; $nbL=1; - for my $lQuery(select_array ('use sys;select table_schema, table_name,index_name, insert_latency from schema_index_statistics ORDER BY insert_latency DESC LIMIT 15;')) { + for my $lQuery(select_array ('use sys;select table_schema, table_name,index_name, insert_latency from schema_index_statistics ORDER BY insert_latency DESC LIMIT 15;')) { infoprint " +-- $nbL: $lQuery"; $nbL++; } @@ -3679,7 +3677,7 @@ sub mysqsl_pfs { # TOP 15 high update latency index subheaderprint "Performance schema: TOP 15 high update latency index"; $nbL=1; - for my $lQuery(select_array ('use sys;select table_schema, table_name,index_name, update_latency from schema_index_statistics ORDER BY update_latency DESC LIMIT 15;')) { + for my $lQuery(select_array ('use sys;select table_schema, table_name,index_name, update_latency from schema_index_statistics ORDER BY update_latency DESC LIMIT 15;')) { infoprint " +-- $nbL: $lQuery"; $nbL++; } @@ -3688,7 +3686,7 @@ sub mysqsl_pfs { # TOP 15 high delete latency index subheaderprint "Performance schema: TOP 15 high delete latency index"; $nbL=1; - for my $lQuery(select_array ('use sys;select table_schema, table_name,index_name, delete_latency from schema_index_statistics ORDER BY delete_latency DESC LIMIT 15;')) { + for my $lQuery(select_array ('use sys;select table_schema, table_name,index_name, delete_latency from schema_index_statistics ORDER BY delete_latency DESC LIMIT 15;')) { infoprint " +-- $nbL: $lQuery"; $nbL++; } @@ -3715,7 +3713,7 @@ sub mysqsl_pfs { # TOP 15 high read latency tables subheaderprint "Performance schema: TOP 15 high read latency tables"; $nbL=1; - for my $lQuery(select_array ('use sys;select table_schema, table_name, fetch_latency from schema_table_statistics ORDER BY fetch_latency DESC LIMIT 15;')) { + for my $lQuery(select_array ('use sys;select table_schema, table_name, fetch_latency from schema_table_statistics ORDER BY fetch_latency DESC LIMIT 15;')) { infoprint " +-- $nbL: $lQuery"; $nbL++; } @@ -3724,7 +3722,7 @@ sub mysqsl_pfs { # TOP 15 high insert latency tables subheaderprint "Performance schema: TOP 15 high insert latency tables"; $nbL=1; - for my $lQuery(select_array ('use sys;select table_schema, table_name, insert_latency from schema_table_statistics ORDER BY insert_latency DESC LIMIT 15;')) { + for my $lQuery(select_array ('use sys;select table_schema, table_name, insert_latency from schema_table_statistics ORDER BY insert_latency DESC LIMIT 15;')) { infoprint " +-- $nbL: $lQuery"; $nbL++; } @@ -3733,7 +3731,7 @@ sub mysqsl_pfs { # TOP 15 high update latency tables subheaderprint "Performance schema: TOP 15 high update latency tables"; $nbL=1; - for my $lQuery(select_array ('use sys;select table_schema, table_name, update_latency from schema_table_statistics ORDER BY update_latency DESC LIMIT 15;')) { + for my $lQuery(select_array ('use sys;select table_schema, table_name, update_latency from schema_table_statistics ORDER BY update_latency DESC LIMIT 15;')) { infoprint " +-- $nbL: $lQuery"; $nbL++; } @@ -3742,7 +3740,7 @@ sub mysqsl_pfs { # TOP 15 high delete latency tables subheaderprint "Performance schema: TOP 15 high delete latency tables"; $nbL=1; - for my $lQuery(select_array ('use sys;select table_schema, table_name, delete_latency from schema_table_statistics ORDER BY delete_latency DESC LIMIT 15;')) { + for my $lQuery(select_array ('use sys;select table_schema, table_name, delete_latency from schema_table_statistics ORDER BY delete_latency DESC LIMIT 15;')) { infoprint " +-- $nbL: $lQuery"; $nbL++; } @@ -3757,7 +3755,7 @@ sub mysqsl_pfs { } infoprint "No information found or indicators desactivated." if ($nbL == 1); - subheaderprint "Performance schema: Tables not using InnoDb buffer"; + subheaderprint "Performance schema: Tables not using InnoDB buffer"; $nbL=1; for my $lQuery(select_array (' Select table_schema, table_name from sys.schema_table_statistics_with_buffer where innodb_buffer_allocated IS NULL;')) { infoprint " +-- $nbL: $lQuery"; @@ -3765,14 +3763,14 @@ sub mysqsl_pfs { } infoprint "No information found or indicators desactivated." if ($nbL == 1); - subheaderprint "Performance schema: Table not using InnoDb buffer"; + subheaderprint "Performance schema: Table not using InnoDB buffer"; $nbL=1; for my $lQuery(select_array (' Select table_schema, table_name from sys.schema_table_statistics_with_buffer where innodb_buffer_allocated IS NULL;')) { infoprint " +-- $nbL: $lQuery"; $nbL++; } infoprint "No information found or indicators desactivated." if ($nbL == 1); - subheaderprint "Performance schema: Table not using InnoDb buffer"; + subheaderprint "Performance schema: Table not using InnoDB buffer"; $nbL=1; for my $lQuery(select_array (' Select table_schema, table_name from sys.schema_table_statistics_with_buffer where innodb_buffer_allocated IS NULL;')) { infoprint " +-- $nbL: $lQuery"; @@ -3780,7 +3778,7 @@ sub mysqsl_pfs { } infoprint "No information found or indicators desactivated." if ($nbL == 1); - subheaderprint "Performance schema: Top 15 Tables using InnoDb buffer"; + subheaderprint "Performance schema: Top 15 Tables using InnoDB buffer"; $nbL=1; for my $lQuery(select_array ('Select table_schema, table_name,innodb_buffer_allocated from sys.schema_table_statistics_with_buffer where innodb_buffer_allocated IS NOT NULL ORDER BY innodb_buffer_allocated DESC LIMIT 15;')) { infoprint " +-- $nbL: $lQuery"; @@ -3789,7 +3787,7 @@ sub mysqsl_pfs { infoprint "No information found or indicators desactivated." if ($nbL == 1); - subheaderprint "Performance schema: Top 15 Tables with InnoDb buffer free"; + subheaderprint "Performance schema: Top 15 Tables with InnoDB buffer free"; $nbL=1; for my $lQuery(select_array ('Select table_schema, table_name,innodb_buffer_free from sys.schema_table_statistics_with_buffer where innodb_buffer_allocated IS NOT NULL ORDER BY innodb_buffer_free DESC LIMIT 15;')) { infoprint " +-- $nbL: $lQuery"; @@ -3896,7 +3894,7 @@ sub mysqsl_pfs { subheaderprint "Performance schema: TOP 15 total latency queries with sort"; $nbL=1; - for my $lQuery(select_array ('use sys;select db, query, total_latency AS search from statements_with_sorting ORDER BY total_latency DESC LIMIT 15;')) { + for my $lQuery(select_array ('use sys;select db, query, total_latency AS search from statements_with_sorting ORDER BY total_latency DESC LIMIT 15;')) { infoprint " +-- $nbL: $lQuery"; $nbL++; } @@ -3904,7 +3902,7 @@ sub mysqsl_pfs { subheaderprint "Performance schema: TOP 15 merge queries with sort"; $nbL=1; - for my $lQuery(select_array ('use sys;select db, query, sort_merge_passes AS search from statements_with_sorting ORDER BY sort_merge_passes DESC LIMIT 15;')) { + for my $lQuery(select_array ('use sys;select db, query, sort_merge_passes AS search from statements_with_sorting ORDER BY sort_merge_passes DESC LIMIT 15;')) { infoprint " +-- $nbL: $lQuery"; $nbL++; } @@ -3912,7 +3910,7 @@ sub mysqsl_pfs { subheaderprint "Performance schema: TOP 15 average sort merges queries with sort"; $nbL=1; - for my $lQuery(select_array ('use sys;select db, query, avg_sort_merges AS search from statements_with_sorting ORDER BY avg_sort_merges DESC LIMIT 15;')) { + for my $lQuery(select_array ('use sys;select db, query, avg_sort_merges AS search from statements_with_sorting ORDER BY avg_sort_merges DESC LIMIT 15;')) { infoprint " +-- $nbL: $lQuery"; $nbL++; } @@ -3920,7 +3918,7 @@ sub mysqsl_pfs { subheaderprint "Performance schema: TOP 15 scans queries with sort"; $nbL=1; - for my $lQuery(select_array ('use sys;select db, query, sorts_using_scans AS search from statements_with_sorting ORDER BY sorts_using_scans DESC LIMIT 15;')) { + for my $lQuery(select_array ('use sys;select db, query, sorts_using_scans AS search from statements_with_sorting ORDER BY sorts_using_scans DESC LIMIT 15;')) { infoprint " +-- $nbL: $lQuery"; $nbL++; } @@ -3928,7 +3926,7 @@ sub mysqsl_pfs { subheaderprint "Performance schema: TOP 15 range queries with sort"; $nbL=1; - for my $lQuery(select_array ('use sys;select db, query, sort_using_range AS search from statements_with_sorting ORDER BY sort_using_range DESC LIMIT 15;')) { + for my $lQuery(select_array ('use sys;select db, query, sort_using_range AS search from statements_with_sorting ORDER BY sort_using_range DESC LIMIT 15;')) { infoprint " +-- $nbL: $lQuery"; $nbL++; } @@ -3984,7 +3982,7 @@ sub mysqsl_pfs { subheaderprint "Performance schema: TOP 15 queries with temp table to disk"; $nbL=1; - for my $lQuery(select_array ('use sys;select db, query, disk_tmp_tables from statements_with_sorting ORDER BY disk_tmp_tables DESC LIMIT 15;')) { + for my $lQuery(select_array ('use sys;select db, query, disk_tmp_tables from statements_with_sorting ORDER BY disk_tmp_tables DESC LIMIT 15;')) { infoprint " +-- $nbL: $lQuery"; $nbL++; } @@ -4005,7 +4003,7 @@ sub mysqsl_pfs { subheaderprint "Performance schema: TOP 15 class events by number"; $nbL=1; - for my $lQuery(select_array ('use sys;select event_class, total from wait_classes_global_by_latency ORDER BY total DESC LIMIT 15;')) { + for my $lQuery(select_array ('use sys;select event_class, total from wait_classes_global_by_latency ORDER BY total DESC LIMIT 15;')) { infoprint " +-- $nbL: $lQuery"; $nbL++; } @@ -4021,7 +4019,7 @@ sub mysqsl_pfs { subheaderprint "Performance schema: TOP 15 class events by total latency"; $nbL=1; - for my $lQuery(select_array ('use sys;select event_class, total_latency from wait_classes_global_by_latency ORDER BY total_latency DESC LIMIT 15;')) { + for my $lQuery(select_array ('use sys;select event_class, total_latency from wait_classes_global_by_latency ORDER BY total_latency DESC LIMIT 15;')) { infoprint " +-- $nbL: $lQuery"; $nbL++; } @@ -4037,7 +4035,7 @@ sub mysqsl_pfs { subheaderprint "Performance schema: TOP 15 class events by max latency"; $nbL=1; - for my $lQuery(select_array ('use sys;select event_class, max_latency from wait_classes_global_by_latency ORDER BY max_latency DESC LIMIT 15;')) { + for my $lQuery(select_array ('use sys;select event_class, max_latency from wait_classes_global_by_latency ORDER BY max_latency DESC LIMIT 15;')) { infoprint " +-- $nbL: $lQuery"; $nbL++; } @@ -4289,14 +4287,14 @@ having sum(if(c.column_key in ('PRI','UNI'), 1,0)) = 0" else { goodprint "All tables get a primary key"; } - my @nonInnoDbTables = select_array( -"select CONCAT(table_schema,CONCAT('.', table_name)) from information_schema.tables where ENGINE <> 'InnoDb' and table_schema not in ('mysql', 'performance_schema', 'information_schema')" + my @nonInnoDBTables = select_array( +"select CONCAT(table_schema,CONCAT('.', table_name)) from information_schema.tables where ENGINE <> 'InnoDB' and table_schema not in ('mysql', 'performance_schema', 'information_schema')" ); - if ( scalar(@nonInnoDbTables) > 0 ) { + if ( scalar(@nonInnoDBTables) > 0 ) { badprint "Following table(s) are not InnoDB table:"; push @generalrec, "Ensure that all table(s) are InnoDB tables for Galera replication"; - foreach my $badtable (@nonInnoDbTables) { + foreach my $badtable (@nonInnoDBTables) { badprint "\t$badtable"; } } @@ -4311,11 +4309,11 @@ having sum(if(c.column_key in ('PRI','UNI'), 1,0)) = 0" goodprint "Binlog format is in ROW mode."; } if ( $myvar{'innodb_flush_log_at_trx_commit'} != 0 ) { - badprint "Innodb flush log at each commit should be disabled."; + badprint "InnoDB flush log at each commit should be disabled."; push @adjvars, "innodb_flush_log_at_trx_commit = 0"; } else { - goodprint "Innodb flush log at each commit is disabled for Galera."; + goodprint "InnoDB flush log at each commit is disabled for Galera."; } infoprint "Read consistency mode :" . $myvar{'wsrep_causal_reads'}; @@ -4546,15 +4544,15 @@ sub mysql_innodb { . ") if possible." ); } if ($mycalc{'innodb_log_size_pct'} < 20 or $mycalc{'innodb_log_size_pct'} > 30) { - badprint "Ratio InnoDB log file size / InnoDb Buffer pool size (". + badprint "Ratio InnoDB log file size / InnoDB Buffer pool size (". $mycalc{'innodb_log_size_pct'}. " %): " . hr_bytes( $myvar{'innodb_log_file_size'} ) . "/" . hr_bytes( $myvar{'innodb_buffer_pool_size'} ) . " should be equal 25%"; push( @adjvars, - "innodb_log_file_size should be equals to 1/4 of buffer pool size (= " + "innodb_log_file_size should be equals to 1/4 of buffer pool size (=" . hr_bytes_rnd( $myvar{'innodb_buffer_pool_size'}/4 ) . ") if possible." ); } else { - goodprint "InnoDB log file size / InnoDb Buffer pool size: " + goodprint "InnoDB log file size / InnoDB Buffer pool size: " . hr_bytes( $myvar{'innodb_log_file_size'} ) . "/" . hr_bytes( $myvar{'innodb_buffer_pool_size'} ) . " should be equal 25%"; } From 915be0fbe4f84b7db94a25baccbaa21ea63a485c Mon Sep 17 00:00:00 2001 From: Karl Chen Date: Mon, 24 Oct 2016 00:38:32 +0800 Subject: [PATCH 07/12] Non importance changes --- mysqltuner.pl | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/mysqltuner.pl b/mysqltuner.pl index 29f5822..1783491 100755 --- a/mysqltuner.pl +++ b/mysqltuner.pl @@ -681,7 +681,7 @@ sub mysql_setup { $opt{port} = ( $opt{port} eq 0 ) ? 3306 : $opt{port}; # If we're doing a remote connection, but forcemem wasn't specified, we need to exit - if ( $opt{'forcemem'} eq 0 + if ( $opt{'forcemem'} eq 0 && ( $opt{host} ne "127.0.0.1" ) && ( $opt{host} ne "localhost" ) ) { @@ -1658,7 +1658,7 @@ sub get_replication_status { badprint "This replication slave is not running but seems to be configured."; } - if ( defined($io_running) + if ( defined($io_running) && $io_running =~ /yes/i && $sql_running =~ /yes/i ) { @@ -1898,7 +1898,7 @@ sub check_storage_engines { # Now we build a database list, and loop through it to get storage engine stats for tables foreach my $db (@dblist) { chomp($db); - if ( $db eq "information_schema" + if ( $db eq "information_schema" or $db eq "performance_schema" or $db eq "mysql" or $db eq "lost+found" ) @@ -2516,7 +2516,7 @@ sub mysql_stats { } } - if ( $arch + if ( $arch && $arch == 32 && $mycalc{'max_used_memory'} > 2 * 1024 * 1024 * 1024 ) { @@ -2751,7 +2751,7 @@ sub mysql_stats { # Temporary tables if ( $mystat{'Created_tmp_tables'} > 0 ) { - if ( $mycalc{'pct_temp_disk'} > 25 + if ( $mycalc{'pct_temp_disk'} > 25 && $mycalc{'max_tmp_table_size'} < 256 * 1024 * 1024 ) { badprint @@ -2916,7 +2916,7 @@ sub mysql_stats { # Binlog cache if ( defined $mycalc{'pct_binlog_cache'} ) { - if ( $mycalc{'pct_binlog_cache'} < 90 + if ( $mycalc{'pct_binlog_cache'} < 90 && $mystat{'Binlog_cache_use'} > 0 ) { badprint "Binlog cache memory access: " . $mycalc{'pct_binlog_cache'} . "% (" @@ -3002,7 +3002,7 @@ sub mysql_myisam { badprint "None of your MyISAM tables are indexed - add indexes immediately"; } else { - if ( $myvar{'key_buffer_size'} < $mycalc{'total_myisam_indexes'} + if ( $myvar{'key_buffer_size'} < $mycalc{'total_myisam_indexes'} && $mycalc{'pct_keys_from_mem'} < 95 ) { badprint "Key buffer size / total MyISAM indexes: " @@ -3088,7 +3088,7 @@ sub mariadb_threadpool { } if ( $myvar{'have_innodb'} eq 'YES' ) { - if ( $myvar{'thread_pool_size'} < 16 + if ( $myvar{'thread_pool_size'} < 16 or $myvar{'thread_pool_size'} > 36 ) { badprint @@ -4770,7 +4770,7 @@ sub mysql_databases { foreach (@dblist) { chomp($_); - if ( $_ eq "information_schema" + if ( $_ eq "information_schema" or $_ eq "performance_schema" or $_ eq "mysql" or $_ eq "" ) From f4e46cdbc069ad287fd1109e4052783c0b1ba8ae Mon Sep 17 00:00:00 2001 From: Karl Chen Date: Mon, 24 Oct 2016 07:34:19 +0800 Subject: [PATCH 08/12] Non importance changes --- mysqltuner.pl | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/mysqltuner.pl b/mysqltuner.pl index 1783491..489c916 100755 --- a/mysqltuner.pl +++ b/mysqltuner.pl @@ -3413,7 +3413,7 @@ sub mysqsl_pfs { # Process per allocated memory subheaderprint "Performance schema: Process per allocated memory"; $nbL=1; - for my $lQuery(select_array ("select concat(user,concat('/', IFNULL(Command,'NONE'))) AS PROC, current_memory from sys.processlist ORDER BY current_memory DESC;" )) { + for my $lQuery(select_array ("select concat(user,concat('/', IFNULL(Command,'NONE'))) AS PROC, current_memory from sys.processlist ORDER BY current_memory DESC;" )) { infoprint " +-- $nbL: $lQuery"; $nbL++; } @@ -3780,7 +3780,7 @@ sub mysqsl_pfs { subheaderprint "Performance schema: Top 15 Tables using InnoDB buffer"; $nbL=1; - for my $lQuery(select_array ('Select table_schema, table_name,innodb_buffer_allocated from sys.schema_table_statistics_with_buffer where innodb_buffer_allocated IS NOT NULL ORDER BY innodb_buffer_allocated DESC LIMIT 15;')) { + for my $lQuery(select_array ('select table_schema, table_name,innodb_buffer_allocated from sys.schema_table_statistics_with_buffer where innodb_buffer_allocated IS NOT NULL ORDER BY innodb_buffer_allocated DESC LIMIT 15;')) { infoprint " +-- $nbL: $lQuery"; $nbL++; } @@ -3789,7 +3789,7 @@ sub mysqsl_pfs { subheaderprint "Performance schema: Top 15 Tables with InnoDB buffer free"; $nbL=1; - for my $lQuery(select_array ('Select table_schema, table_name,innodb_buffer_free from sys.schema_table_statistics_with_buffer where innodb_buffer_allocated IS NOT NULL ORDER BY innodb_buffer_free DESC LIMIT 15;')) { + for my $lQuery(select_array ('select table_schema, table_name,innodb_buffer_free from sys.schema_table_statistics_with_buffer where innodb_buffer_allocated IS NOT NULL ORDER BY innodb_buffer_free DESC LIMIT 15;')) { infoprint " +-- $nbL: $lQuery"; $nbL++; } @@ -5441,4 +5441,3 @@ along with this program. If not, see . # cperl-indent-level: 8 # perl-indent-level: 8 # End: - From 4f1a6ec38b20ecaa6f629089957ae3889a7dbf28 Mon Sep 17 00:00:00 2001 From: Karl Chen Date: Mon, 24 Oct 2016 07:36:05 +0800 Subject: [PATCH 09/12] Non importance changes --- mysqltuner.pl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mysqltuner.pl b/mysqltuner.pl index 489c916..23539d5 100755 --- a/mysqltuner.pl +++ b/mysqltuner.pl @@ -3780,7 +3780,7 @@ sub mysqsl_pfs { subheaderprint "Performance schema: Top 15 Tables using InnoDB buffer"; $nbL=1; - for my $lQuery(select_array ('select table_schema, table_name,innodb_buffer_allocated from sys.schema_table_statistics_with_buffer where innodb_buffer_allocated IS NOT NULL ORDER BY innodb_buffer_allocated DESC LIMIT 15;')) { + for my $lQuery(select_array ('select table_schema,table_name,innodb_buffer_allocated from sys.schema_table_statistics_with_buffer where innodb_buffer_allocated IS NOT NULL ORDER BY innodb_buffer_allocated DESC LIMIT 15;')) { infoprint " +-- $nbL: $lQuery"; $nbL++; } @@ -3789,7 +3789,7 @@ sub mysqsl_pfs { subheaderprint "Performance schema: Top 15 Tables with InnoDB buffer free"; $nbL=1; - for my $lQuery(select_array ('select table_schema, table_name,innodb_buffer_free from sys.schema_table_statistics_with_buffer where innodb_buffer_allocated IS NOT NULL ORDER BY innodb_buffer_free DESC LIMIT 15;')) { + for my $lQuery(select_array ('select table_schema,table_name,innodb_buffer_free from sys.schema_table_statistics_with_buffer where innodb_buffer_allocated IS NOT NULL ORDER BY innodb_buffer_free DESC LIMIT 15;')) { infoprint " +-- $nbL: $lQuery"; $nbL++; } @@ -5441,3 +5441,4 @@ along with this program. If not, see . # cperl-indent-level: 8 # perl-indent-level: 8 # End: + From f68b731498d05d7a4116707637fe3b8080fe5a68 Mon Sep 17 00:00:00 2001 From: Karl Chen Date: Mon, 24 Oct 2016 17:21:56 +0800 Subject: [PATCH 10/12] Non importance changes --- mysqltuner.pl | 62 +++++++++++++++++++++++++-------------------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/mysqltuner.pl b/mysqltuner.pl index 23539d5..2c59299 100755 --- a/mysqltuner.pl +++ b/mysqltuner.pl @@ -206,7 +206,7 @@ if ( $opt{verbose} ) { $opt{pfstat} = 1; #Print performance schema info. $opt{cvefile} = 'vulnerabilities.csv'; #CVE File for vulnerability checks } - + # for RPM distributions $opt{cvefile} = "/usr/share/mysqltuner/vulnerabilities.csv" unless ( defined $opt{cvefile} and -f "$opt{cvefile}" ); @@ -810,7 +810,7 @@ sub mysql_setup { debugprint "defaults file detected: $opt{'defaults-file'}"; my $mysqlclidefaults = `$mysqlcmd --print-defaults`; debugprint "MySQL Client Default File: $opt{'defaults-file'}"; - + $mysqllogin = "--defaults-file=".$opt{'defaults-file'}; my $loginstatus = `$mysqladmincmd $mysqllogin ping 2>&1`; if ( $loginstatus =~ /mysqld is alive/ ) { @@ -3159,10 +3159,10 @@ sub mysqsl_pfs { infoprint "Sys schema is installed."; return if ( $opt{pfstat} == 0 ); - + infoprint "Sys schema Version: ".select_one("select sys_version from sys.version"); - # Top user per connection + # Top user per connection subheaderprint "Performance schema: Top 5 user per connection"; my $nbL=1; for my $lQuery(select_array ('select user, total_connections from sys.user_summary order by total_connections desc LIMIT 5')) { @@ -3171,7 +3171,7 @@ sub mysqsl_pfs { } infoprint "No information found or indicators desactivated." if ($nbL == 1); - # Top user per statement + # Top user per statement subheaderprint "Performance schema: Top 5 user per statement"; $nbL=1; for my $lQuery(select_array ('select user, statements from sys.user_summary order by statements desc LIMIT 5')) { @@ -3208,7 +3208,7 @@ sub mysqsl_pfs { } infoprint "No information found or indicators desactivated." if ($nbL == 1); - + # Top user per row_sent subheaderprint "Performance schema: Top 5 user per rows sent"; $nbL=1; @@ -3217,7 +3217,7 @@ sub mysqsl_pfs { $nbL++; } infoprint "No information found or indicators desactivated." if ($nbL == 1); - + # Top user per row modified subheaderprint "Performance schema: Top 5 user per rows modified"; $nbL=1; @@ -3245,7 +3245,7 @@ sub mysqsl_pfs { } infoprint "No information found or indicators desactivated." if ($nbL == 1); - # Top host per connection + # Top host per connection subheaderprint "Performance schema: Top 5 host per connection"; $nbL=1; for my $lQuery(select_array ('select host, total_connections from sys.host_summary order by total_connections desc LIMIT 5')) { @@ -3254,7 +3254,7 @@ sub mysqsl_pfs { } infoprint "No information found or indicators desactivated." if ($nbL == 1); - # Top host per statement + # Top host per statement subheaderprint "Performance schema: Top 5 host per statement"; $nbL=1; for my $lQuery(select_array ('select host, statements from sys.host_summary order by statements desc LIMIT 5')) { @@ -3291,7 +3291,7 @@ sub mysqsl_pfs { } infoprint "No information found or indicators desactivated." if ($nbL == 1); - + # Top host per rows sent subheaderprint "Performance schema: Top 5 host per rows sent"; $nbL=1; @@ -3300,7 +3300,7 @@ sub mysqsl_pfs { $nbL++; } infoprint "No information found or indicators desactivated." if ($nbL == 1); - + # Top host per rows modified subheaderprint "Performance schema: Top 5 host per rows modified"; $nbL=1; @@ -3354,7 +3354,7 @@ sub mysqsl_pfs { $nbL++; } infoprint "No information found or indicators desactivated." if ($nbL == 1); - + # Top Stages order by total io subheaderprint "Performance schema: Top Stages order by total io"; $nbL=1; @@ -3427,7 +3427,7 @@ sub mysqsl_pfs { $nbL++; } infoprint "No information found or indicators desactivated." if ($nbL == 1); - + # Threads IO Latency subheaderprint "Performance schema: Thread IO Latency"; $nbL=1; @@ -3437,7 +3437,7 @@ sub mysqsl_pfs { } infoprint "No information found or indicators desactivated." if ($nbL == 1); - # High Cost SQL statements + # High Cost SQL statements subheaderprint "Performance schema: Top 5 Most latency statements"; $nbL=1; for my $lQuery(select_array ('select query, avg_latency from sys.statement_analysis order by avg_latency desc LIMIT 5')) { @@ -3445,8 +3445,8 @@ sub mysqsl_pfs { $nbL++; } infoprint "No information found or indicators desactivated." if ($nbL == 1); - - # Top 5% slower queries + + # Top 5% slower queries subheaderprint "Performance schema: Top 5 slower queries"; $nbL=1; for my $lQuery(select_array ('select query, exec_count from sys.statements_with_runtimes_in_95th_percentile order by exec_count desc LIMIT 5')) { @@ -3509,7 +3509,7 @@ sub mysqsl_pfs { } infoprint "No information found or indicators desactivated." if ($nbL == 1); - # Use temporary tables + # Use temporary tables subheaderprint "Performance schema: Some queries using temp table"; $nbL=1; for my $lQuery(select_array ('use sys;select query from sys.statements_with_temp_tables LIMIT 20')) { @@ -3517,8 +3517,8 @@ sub mysqsl_pfs { $nbL++; } infoprint "No information found or indicators desactivated." if ($nbL == 1); - - # Unused Indexes + + # Unused Indexes subheaderprint "Performance schema: Unused indexes"; $nbL=1; for my $lQuery(select_array ('select * from sys.schema_unused_indexes')) { @@ -3527,7 +3527,7 @@ sub mysqsl_pfs { } infoprint "No information found or indicators desactivated." if ($nbL == 1); - # Full table scans + # Full table scans subheaderprint "Performance schema: Tables with full table scans"; $nbL=1; for my $lQuery(select_array ('select * from sys.schema_tables_with_full_table_scans order by rows_full_scanned DESC')) { @@ -3655,7 +3655,7 @@ sub mysqsl_pfs { $nbL++; } infoprint "No information found or indicators desactivated." if ($nbL == 1); - + # TOP 15 high read latency index subheaderprint "Performance schema: TOP 15 high read latency index"; $nbL=1; @@ -3709,7 +3709,7 @@ sub mysqsl_pfs { $nbL++; } infoprint "No information found or indicators desactivated." if ($nbL == 1); - + # TOP 15 high read latency tables subheaderprint "Performance schema: TOP 15 high read latency tables"; $nbL=1; @@ -3842,7 +3842,7 @@ sub mysqsl_pfs { $nbL++; } infoprint "No information found or indicators desactivated." if ($nbL == 1); - + subheaderprint "Performance schema: TOP 15 total latency queries (95% percentile)"; $nbL=1; for my $lQuery(select_array ('use sys;select db, query, total_latency AS search from statements_with_runtimes_in_95th_percentile ORDER BY total_latency DESC LIMIT 15;')) { @@ -3858,7 +3858,7 @@ sub mysqsl_pfs { $nbL++; } infoprint "No information found or indicators desactivated." if ($nbL == 1); - + subheaderprint "Performance schema: TOP 15 average latency queries (95% percentile)"; $nbL=1; for my $lQuery(select_array ('use sys;select db, query, avg_latency AS search from statements_with_runtimes_in_95th_percentile ORDER BY avg_latency DESC LIMIT 15;')) { @@ -3867,7 +3867,7 @@ sub mysqsl_pfs { } infoprint "No information found or indicators desactivated." if ($nbL == 1); - + subheaderprint "Performance schema: Top 20 queries with sort"; $nbL=1; for my $lQuery(select_array ('select db, query, exec_count from sys.statements_with_sorting order BY exec_count DESC LIMIT 20;')) { @@ -3907,7 +3907,7 @@ sub mysqsl_pfs { $nbL++; } infoprint "No information found or indicators desactivated." if ($nbL == 1); - + subheaderprint "Performance schema: TOP 15 average sort merges queries with sort"; $nbL=1; for my $lQuery(select_array ('use sys;select db, query, avg_sort_merges AS search from statements_with_sorting ORDER BY avg_sort_merges DESC LIMIT 15;')) { @@ -3915,7 +3915,7 @@ sub mysqsl_pfs { $nbL++; } infoprint "No information found or indicators desactivated." if ($nbL == 1); - + subheaderprint "Performance schema: TOP 15 scans queries with sort"; $nbL=1; for my $lQuery(select_array ('use sys;select db, query, sorts_using_scans AS search from statements_with_sorting ORDER BY sorts_using_scans DESC LIMIT 15;')) { @@ -4513,7 +4513,7 @@ sub mysql_innodb { infoprint " +-- InnoDB Log File Size: " . hr_bytes( $myvar{'innodb_log_file_size'} ) . "(".$mycalc{'innodb_log_size_pct'}." % of buffer pool)"; } - + if ( defined $myvar{'innodb_log_buffer_size'} ) { infoprint " +-- InnoDB Log Buffer: " . hr_bytes( $myvar{'innodb_log_buffer_size'} ) ; @@ -4919,7 +4919,7 @@ SELECT , s2.max_columns AS 'maxcol' , s.CARDINALITY AS 'card' , t.TABLE_ROWS AS 'est_rows' - , INDEX_TYPE as type + , INDEX_TYPE as type , ROUND(((s.CARDINALITY / IFNULL(t.TABLE_ROWS, 0.01)) * 100), 2) AS 'sel' FROM INFORMATION_SCHEMA.STATISTICS s INNER JOIN INFORMATION_SCHEMA.TABLES t @@ -5165,7 +5165,7 @@ mariadb_threadpool; # Print MaraiDB ThreadPool stats mysql_myisam; # Print MyISAM stats mysql_innodb; # Print InnoDB stats mariadb_ariadb; # Print MaraiDB AriaDB stats -mariadb_tokudb; # Print MariaDB Tokudb stats +mariadb_tokudb; # Print MariaDB Tokudb stats mariadb_xtradb; # Print MariaDB XtraDB stats mariadb_rockdb; # Print MariaDB RockDB stats mariadb_spider; # Print MariaDB Spider stats @@ -5228,7 +5228,7 @@ You must provide the remote server's total memory when connecting to other serve --dbstat Print database information --idxstat Print index information --sysstat Print system information - --pfstat Print Performance schema + --pfstat Print Performance schema --bannedports Ports banned separated by comma(,) --maxportallowed Number of ports opened allowed on this hosts --cvefile CVE File for vulnerability checks From 05c1e6eb7557fbb56b366de1ba0b2d6c6e5745e2 Mon Sep 17 00:00:00 2001 From: Karl Chen Date: Mon, 24 Oct 2016 17:25:07 +0800 Subject: [PATCH 11/12] Non importance changes --- mysqltuner.pl | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/mysqltuner.pl b/mysqltuner.pl index 2c59299..418eed8 100755 --- a/mysqltuner.pl +++ b/mysqltuner.pl @@ -1343,7 +1343,7 @@ sub get_kernel_info() { 'fs.aio-max-nr > 1M (echo 1048576 > /proc/sys/fs/aio-max-nr)'; } else { - infoprint "Max Number of AIO events is > 1M."; + infoprint "Max Number of AIO events is > 1M."; } } @@ -1767,7 +1767,7 @@ sub check_architecture { } elsif ( `uname` =~ /Darwin/ && `uname -m` =~ /x86_64/ ) { -# Darwin gibas.local 12.3.0 Darwin Kernel Version 12.3.0: Sun Jan 6 22:37:10 PST 2013; root:xnu-2050.22.13~1/RELEASE_X86_64 x86_64 +# Darwin gibas.local 12.3.0 Darwin Kernel Version 12.3.0: Sun Jan 6 22:37:10 PST 2013; root:xnu-2050.22.13~1/RELEASE_X86_64 x86_64 $arch = 64; goodprint "Operating on 64-bit architecture"; } @@ -3165,7 +3165,7 @@ sub mysqsl_pfs { # Top user per connection subheaderprint "Performance schema: Top 5 user per connection"; my $nbL=1; - for my $lQuery(select_array ('select user, total_connections from sys.user_summary order by total_connections desc LIMIT 5')) { + for my $lQuery(select_array ('select user, total_connections from sys.user_summary order by total_connections desc LIMIT 5')) { infoprint " +-- $nbL: $lQuery conn(s)"; $nbL++; } @@ -3248,7 +3248,7 @@ sub mysqsl_pfs { # Top host per connection subheaderprint "Performance schema: Top 5 host per connection"; $nbL=1; - for my $lQuery(select_array ('select host, total_connections from sys.host_summary order by total_connections desc LIMIT 5')) { + for my $lQuery(select_array ('select host, total_connections from sys.host_summary order by total_connections desc LIMIT 5')) { infoprint " +-- $nbL: $lQuery conn(s)"; $nbL++; } @@ -3546,7 +3546,7 @@ sub mysqsl_pfs { infoprint "No information found or indicators desactivated." if ($nbL == 1); - # FILE by IO read bytes + # FILE by IO read bytes subheaderprint "Performance schema: FILE by IO read bytes"; $nbL=1; for my $lQuery(select_array ("use sys;(select file, total_read from io_global_by_file_by_bytes where total_read like '%MiB' order by total_read DESC) UNION (select file, total_read from io_global_by_file_by_bytes where total_read like '%KiB' order by total_read DESC LIMIT 15);")) { @@ -3555,7 +3555,7 @@ sub mysqsl_pfs { } infoprint "No information found or indicators desactivated." if ($nbL == 1); - # FILE by IO written bytes + # FILE by IO written bytes subheaderprint "Performance schema: FILE by IO written bytes"; $nbL=1; for my $lQuery(select_array ("use sys;(select file, total_written from io_global_by_file_by_bytes where total_written like '%MiB' order by total_written DESC) UNION (select file, total_written from io_global_by_file_by_bytes where total_written like '%KiB' order by total_written DESC LIMIT 15);")) { @@ -3602,7 +3602,7 @@ sub mysqsl_pfs { infoprint "No information found or indicators desactivated." if ($nbL == 1); # Event Wait by write bytes - subheaderprint "Performance schema: Event Wait written bytes"; + subheaderprint "Performance schema: Event Wait written bytes"; $nbL=1; for my $lQuery(select_array ("use sys;(select event_name, total_written from io_global_by_wait_by_bytes where total_written like '%MiB' order by total_written DESC) UNION (select event_name, total_written from io_global_by_wait_by_bytes where total_written like '%KiB' order by total_written DESC LIMIT 15);")) { infoprint " +-- $nbL: $lQuery"; @@ -4792,7 +4792,7 @@ sub mysql_databases { . ( join ", ", select_array( -"SELECT DISTINCT(TABLE_COLLATION) FROM information_schema.TABLES WHERE TABLE_SCHEMA='$_';" +"SELECT DISTINCT(TABLE_COLLATION) FROM information_schema.TABLES WHERE TABLE_SCHEMA='$_';" ) ) . ")"; infoprint " +-- ROWS : " @@ -4857,13 +4857,13 @@ sub mysql_databases { } my @distinct_column_charset = select_array( -"select DISTINCT(CHARACTER_SET_NAME) from information_schema.COLUMNS where CHARACTER_SET_NAME IS NOT NULL AND TABLE_SCHEMA ='$_'" +"select DISTINCT(CHARACTER_SET_NAME) from information_schema.COLUMNS where CHARACTER_SET_NAME IS NOT NULL AND TABLE_SCHEMA ='$_'" ); infoprint "Charsets for $dbinfo[0] database table column: " . join( ', ', @distinct_column_charset ); if ( scalar(@distinct_column_charset) > 1 ) { badprint $dbinfo[0] - . " table column(s) has several charsets defined for all text like column(s)."; + . " table column(s) has several charsets defined for all text like column(s)."; push( @generalrec, "Limit charset for column to one charset if possible for " . $dbinfo[0] @@ -4875,13 +4875,13 @@ sub mysql_databases { } my @distinct_column_collation = select_array( -"select DISTINCT(COLLATION_NAME) from information_schema.COLUMNS where COLLATION_NAME IS NOT NULL AND TABLE_SCHEMA ='$_'" +"select DISTINCT(COLLATION_NAME) from information_schema.COLUMNS where COLLATION_NAME IS NOT NULL AND TABLE_SCHEMA ='$_'" ); infoprint "Collations for $dbinfo[0] database table column: " . join( ', ', @distinct_column_collation ); if ( scalar(@distinct_column_collation) > 1 ) { badprint $dbinfo[0] - . " table column(s) has several collations defined for all text like column(s)."; + . " table column(s) has several collations defined for all text like column(s)."; push( @generalrec, "Limit collations for column to one collation if possible for " . $dbinfo[0] From 5a3873ece4c69c3b27f37f4f14b15c450e944e21 Mon Sep 17 00:00:00 2001 From: Henrique Moody Date: Thu, 27 Oct 2016 15:28:41 +0200 Subject: [PATCH 12/12] Use single quotes around password Password may contain characters, like `$` and `!`, that may be interpreted by the shell. Prevent it to happen by using single quotes. --- mysqltuner.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysqltuner.pl b/mysqltuner.pl index 1628469..156dea2 100755 --- a/mysqltuner.pl +++ b/mysqltuner.pl @@ -873,7 +873,7 @@ sub mysql_setup { $mysqllogin = "-u $name"; if ( length($password) > 0 ) { - $mysqllogin .= " -p\"$password\""; + $mysqllogin .= " -p'$password'"; } $mysqllogin .= $remotestring; my $loginstatus = `$mysqladmincmd ping $mysqllogin 2>&1`;