From 34dcfd05c94c71271c0f91ea177a78b3a9e353fb Mon Sep 17 00:00:00 2001 From: Jean-Marie Renouard Date: Wed, 7 Feb 2024 00:07:41 +0100 Subject: [PATCH 1/3] Adding secure check when missing value --- mysqltuner.pl | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/mysqltuner.pl b/mysqltuner.pl index 2006e20..8019092 100755 --- a/mysqltuner.pl +++ b/mysqltuner.pl @@ -6372,13 +6372,15 @@ sub mysql_innodb { # ,2) as "PCT ALLOC/BUFFER POOL" #from sys.x$innodb_buffer_stats_by_table; - if ( $mycalc{innodb_buffer_alloc_pct} < 80 ) { - badprint "Ratio Buffer Pool allocated / Buffer Pool Size: " - . $mycalc{'innodb_buffer_alloc_pct'} . '%'; - } - else { - goodprint "Ratio Buffer Pool allocated / Buffer Pool Size: " - . $mycalc{'innodb_buffer_alloc_pct'} . '%'; + if (defined $mycalc{innodb_buffer_alloc_pct}) { + if ( $mycalc{innodb_buffer_alloc_pct} < 80 ) { + badprint "Ratio Buffer Pool allocated / Buffer Pool Size: " + . $mycalc{'innodb_buffer_alloc_pct'} . '%'; + } + else { + goodprint "Ratio Buffer Pool allocated / Buffer Pool Size: " + . $mycalc{'innodb_buffer_alloc_pct'} . '%'; + } } if ( $mycalc{'innodb_log_size_pct'} < 20 or $mycalc{'innodb_log_size_pct'} > 30 ) From 54df506b36b06597898d15ad260ba97090e9ae6c Mon Sep 17 00:00:00 2001 From: Jean-Marie Renouard Date: Wed, 7 Feb 2024 01:05:05 +0100 Subject: [PATCH 2/3] Refactoring format --- README.md | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index a5d9a41..dad7106 100644 --- a/README.md +++ b/README.md @@ -89,7 +89,8 @@ Unmaintenained staff from MySQL or MariaDB: * 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) -* Unrestricted read access to the MySQL server (OS root access recommended for MySQL < 5.1) +* Unrestricted read access to the MySQL server +OS root access recommended for MySQL < 5.1 ***WARNING*** -- @@ -165,13 +166,12 @@ cd mariadb-sys-master mysql -u root -p < ./sys_10.sql ``` - Performance schema setup -- By default, performance_schema is enabled and sysschema is installed on latest version. -By default, on MariaDB, performance schema is disabled by default (MariaDB<10.6). +By default, on MariaDB, performance schema is disabled by default (MariaDB<10.6). Consider activating performance schema across your my.cnf configuration file: @@ -473,15 +473,22 @@ After which, `~/.mylogin.cnf` will be created with the appropriate access. To get information about stored credentials, use the following command: - $mysql_config_editor print - [client] - user = someusername - password = ***** - host = localhost +```bash +$mysql_config_editor print +[client] +user = someusername +password = ***** +host = localhost +``` **Question: What's minimum privileges needed by a specific mysqltuner user in database ?** - mysql>GRANT SELECT, PROCESS,EXECUTE, REPLICATION CLIENT,SHOW DATABASES,SHOW VIEW ON *.* TO 'mysqltuner'@'localhost' identified by pwd1234; +```bash + mysql>GRANT SELECT, PROCESS,EXECUTE, REPLICATION CLIENT, + SHOW DATABASES,SHOW VIEW + ON *.* + TO 'mysqltuner'@'localhost' identified by pwd1234; +``` **Question: It's not working on my OS! What gives?!** From 9e243c4d63d763fb78e78c4cede453a39455156c Mon Sep 17 00:00:00 2001 From: Jean-Marie Renouard Date: Wed, 7 Feb 2024 01:09:53 +0100 Subject: [PATCH 3/3] REfactoring format --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index dad7106..056a78d 100644 --- a/README.md +++ b/README.md @@ -382,7 +382,6 @@ Follow instructions from Github repo [GitHub AHA main repository](https://github.com/theZiz/aha) - **Using AHA Html report generation** perl mysqltuner.pl --verbose --color > reports.txt