Update Vulnerabilities list

Indenting mysqltuner
Update Usage information
This commit is contained in:
Jean-Marie Renouard 2023-03-11 07:48:00 +01:00
parent 881479eca8
commit b29eb05b2b
2 changed files with 76 additions and 55 deletions

View file

@ -1,6 +1,6 @@
# NAME # NAME
MySQLTuner 2.0.10 - MySQL High Performance Tuning Script MySQLTuner 2.1.1 - MySQL High Performance Tuning Script
# IMPORTANT USAGE GUIDELINES # IMPORTANT USAGE GUIDELINES
@ -23,7 +23,7 @@ You must provide the remote server's total memory when connecting to other serve
--mysqladmin <path> Path to a custom mysqladmin executable --mysqladmin <path> Path to a custom mysqladmin executable
--mysqlcmd <path> Path to a custom mysql executable --mysqlcmd <path> Path to a custom mysql executable
--defaults-file <path> Path to a custom .my.cnf --defaults-file <path> Path to a custom .my.cnf
--defaults-extra-file <path> Path to a extra custom config file --defaults-extra-file <path> Path to an extra custom config file
--server-log <path> Path to explicit log file (error_log) --server-log <path> Path to explicit log file (error_log)
# PERFORMANCE AND REPORTING OPTIONS # PERFORMANCE AND REPORTING OPTIONS
@ -42,6 +42,7 @@ You must provide the remote server's total memory when connecting to other serve
--outputfile <path> Path to a output txt file --outputfile <path> Path to a output txt file
--reportfile <path> Path to a report txt file --reportfile <path> Path to a report txt file
--template <path> Path to a template file --template <path> Path to a template file
--dumpdir <path> Path to a directory where to dump information files
# OUTPUT OPTIONS # OUTPUT OPTIONS
@ -85,6 +86,7 @@ You can find documentation for this module with the perldoc command.
# AUTHORS # AUTHORS
Major Hayden - major@mhtx.net Major Hayden - major@mhtx.net
Jean-Marie Renouard - jmrenouard@gmail.com
# CONTRIBUTORS # CONTRIBUTORS
@ -122,6 +124,7 @@ Major Hayden - major@mhtx.net
- Jean-Marie Renouard - Jean-Marie Renouard
- Stephan GroBberndt - Stephan GroBberndt
- Christian Loos - Christian Loos
- Long Radix
# SUPPORT # SUPPORT
@ -129,7 +132,7 @@ Bug reports, feature requests, and downloads at http://mysqltuner.pl/
Bug tracker can be found at https://github.com/major/MySQLTuner-perl/issues Bug tracker can be found at https://github.com/major/MySQLTuner-perl/issues
Maintained by Major Hayden (major\\@mhtx.net) - Licensed under GPL Maintained by Jean-Marie Renouard (jmrenouard\\@gmail.com) - Licensed under GPL
# SOURCE CODE # SOURCE CODE
@ -139,7 +142,8 @@ Maintained by Major Hayden (major\\@mhtx.net) - Licensed under GPL
# COPYRIGHT AND LICENSE # COPYRIGHT AND LICENSE
Copyright (C) 2006-2022 Major Hayden - major@mhtx.net Copyright (C) 2006-2023 Major Hayden - major@mhtx.net
\# Copyright (C) 2015-2023 Jean-Marie Renouard - jmrenouard@gmail.com
For the latest updates, please visit http://mysqltuner.pl/ For the latest updates, please visit http://mysqltuner.pl/

View file

@ -193,6 +193,7 @@ if ($opt{dumpdir} ne '') {
mkdir $opt{dumpdir} or die "Cannot create directory $opt{dumpdir}: $!"; mkdir $opt{dumpdir} or die "Cannot create directory $opt{dumpdir}: $!";
} }
} }
# for RPM distributions # for RPM distributions
$basic_password_files = "/usr/share/mysqltuner/basic_passwords.txt" $basic_password_files = "/usr/share/mysqltuner/basic_passwords.txt"
unless -f "$basic_password_files"; unless -f "$basic_password_files";
@ -799,7 +800,10 @@ sub mysql_setup {
# Did we already get a username with or without password on the command line? # Did we already get a username with or without password on the command line?
if ( $opt{user} ne 0 ) { if ( $opt{user} ne 0 ) {
$mysqllogin = "-u $opt{user} " . (($opt{pass} ne 0) ? "-p'$opt{pass}' " : " ") . $remotestring; $mysqllogin =
"-u $opt{user} "
. ( ( $opt{pass} ne 0 ) ? "-p'$opt{pass}' " : " " )
. $remotestring;
my $loginstatus = `$mysqladmincmd ping $mysqllogin 2>&1`; my $loginstatus = `$mysqladmincmd ping $mysqllogin 2>&1`;
if ( $loginstatus =~ /mysqld is alive/ ) { if ( $loginstatus =~ /mysqld is alive/ ) {
goodprint "Logged in using credentials passed on the command line"; goodprint "Logged in using credentials passed on the command line";
@ -988,6 +992,7 @@ sub mysql_setup {
$mysqllogin .= $remotestring; $mysqllogin .= $remotestring;
my $loginstatus = `$mysqladmincmd ping $mysqllogin 2>&1`; my $loginstatus = `$mysqladmincmd ping $mysqllogin 2>&1`;
if ( $loginstatus =~ /mysqld is alive/ ) { if ( $loginstatus =~ /mysqld is alive/ ) {
#print STDERR ""; #print STDERR "";
if ( !length($password) ) { if ( !length($password) ) {
@ -1031,6 +1036,7 @@ sub select_array {
chomp(@result); chomp(@result);
return @result; return @result;
} }
# MySQL Request Array # MySQL Request Array
sub select_csv_file { sub select_csv_file {
my $tfile = shift; my $tfile = shift;
@ -1046,6 +1052,7 @@ sub select_csv_file {
} }
close $fh; close $fh;
} }
sub human_size { sub human_size {
my ( $size, $n ) = ( shift, 0 ); my ( $size, $n ) = ( shift, 0 );
++$n and $size /= 1024 until $size < 1024; ++$n and $size /= 1024 until $size < 1024;
@ -3921,9 +3928,9 @@ sub mysqsl_pfs {
unless ( grep /^sys$/, select_array("SHOW DATABASES") ) { unless ( grep /^sys$/, select_array("SHOW DATABASES") ) {
infoprint "Sys schema is not installed."; infoprint "Sys schema is not installed.";
push( @generalrec, push( @generalrec,
mysql_version_ge( 10, 0 ) ? mysql_version_ge( 10, 0 )
"Consider installing Sys schema from https://github.com/FromDual/mariadb-sys for MariaDB" : ? "Consider installing Sys schema from https://github.com/FromDual/mariadb-sys for MariaDB"
"Consider installing Sys schema from https://github.com/mysql/mysql-sys for MySQL" : "Consider installing Sys schema from https://github.com/mysql/mysql-sys for MySQL"
) unless ( mysql_version_le( 5, 6 ) ); ) unless ( mysql_version_le( 5, 6 ) );
return; return;
@ -3938,9 +3945,13 @@ sub mysqsl_pfs {
if ( defined $opt{dumpdir} and -d "$opt{dumpdir}" ) { if ( defined $opt{dumpdir} and -d "$opt{dumpdir}" ) {
for my $pfs_view ( select_array('use sys;show tables;') ) { for my $pfs_view ( select_array('use sys;show tables;') ) {
infoprint "Dumping $pfs_view into $opt{dumpdir}"; infoprint "Dumping $pfs_view into $opt{dumpdir}";
select_csv_file("$opt{dumpdir}/pfs_$pfs_view.csv", "select * from sys.$pfs_view"); select_csv_file(
"$opt{dumpdir}/pfs_$pfs_view.csv",
"select * from sys.$pfs_view"
);
} }
} }
# Top user per connection # Top user per connection
subheaderprint "Performance schema: Top 5 user per connection"; subheaderprint "Performance schema: Top 5 user per connection";
my $nbL = 1; my $nbL = 1;
@ -6463,11 +6474,17 @@ sub mysql_tables {
infoprint "Disabling colstat parameter"; infoprint "Disabling colstat parameter";
} }
# Store all information schema in dumpdir if defined # Store all information schema in dumpdir if defined
if ( defined $opt{dumpdir} and -d "$opt{dumpdir}" ) { if ( defined $opt{dumpdir} and -d "$opt{dumpdir}" ) {
for my $info_s_table(select_array('use information_schema;show tables;')){ for my $info_s_table (
select_array('use information_schema;show tables;') )
{
infoprint "Dumping $info_s_table into $opt{dumpdir}"; infoprint "Dumping $info_s_table into $opt{dumpdir}";
select_csv_file("$opt{dumpdir}/ifs_${info_s_table}.csv", "select * from information_schema.$info_s_table"); select_csv_file(
"$opt{dumpdir}/ifs_${info_s_table}.csv",
"select * from information_schema.$info_s_table"
);
} }
} }
foreach ( select_user_dbs() ) { foreach ( select_user_dbs() ) {