Update Vulnerabilities list
Indenting mysqltuner Update Usage information
This commit is contained in:
parent
2e0f388119
commit
ef66fb274c
2 changed files with 1567 additions and 986 deletions
200
mysqltuner.pl
200
mysqltuner.pl
|
@ -685,7 +685,8 @@ sub mysql_setup {
|
|||
exit 1;
|
||||
}
|
||||
elsif ( !-e $mysqladmincmd ) {
|
||||
badprint "Couldn't find mysqladmin/mariadb-admin in your \$PATH. Is MySQL installed?";
|
||||
badprint
|
||||
"Couldn't find mysqladmin/mariadb-admin in your \$PATH. Is MySQL installed?";
|
||||
exit 1;
|
||||
}
|
||||
if ( $opt{mysqlcmd} ) {
|
||||
|
@ -704,7 +705,8 @@ sub mysql_setup {
|
|||
exit 1;
|
||||
}
|
||||
elsif ( !-e $mysqlcmd ) {
|
||||
badprint "Couldn't find mysql/mariadb in your \$PATH. Is MySQL installed?";
|
||||
badprint
|
||||
"Couldn't find mysql/mariadb in your \$PATH. Is MySQL installed?";
|
||||
exit 1;
|
||||
}
|
||||
$mysqlcmd =~ s/\n$//g;
|
||||
|
@ -1131,7 +1133,8 @@ sub get_all_vars {
|
|||
# Support GTID MODE FOR MARIADB
|
||||
# Issue MariaDB GTID mode #513
|
||||
$myvar{'gtid_mode'} = 'ON'
|
||||
if ( defined( $myvar{'gtid_current_pos'} ) and $myvar{'gtid_current_pos'} ne '' );
|
||||
if ( defined( $myvar{'gtid_current_pos'} )
|
||||
and $myvar{'gtid_current_pos'} ne '' );
|
||||
|
||||
$myvar{'have_threadpool'} = "NO";
|
||||
if ( defined( $myvar{'thread_pool_size'} )
|
||||
|
@ -1223,8 +1226,8 @@ sub get_log_file_real_path {
|
|||
elsif ( -f "$datadir$hostname.log" ) {
|
||||
return "$datadir$hostname.log";
|
||||
}
|
||||
elsif ( -f "$datadir"."mysql_error.log" ) {
|
||||
return "$datadir"."mysql_error.log";
|
||||
elsif ( -f "$datadir" . "mysql_error.log" ) {
|
||||
return "$datadir" . "mysql_error.log";
|
||||
}
|
||||
elsif ( -f "/var/log/mysql.log" ) {
|
||||
return "/var/log/mysql.log";
|
||||
|
@ -1238,8 +1241,8 @@ sub get_log_file_real_path {
|
|||
elsif ( -f "/var/log/mysql/$hostname.log" ) {
|
||||
return "/var/log/mysql/$hostname.log";
|
||||
}
|
||||
elsif ( -f "/var/log/mysql/"."mysql_error.log" ) {
|
||||
return "/var/log/mysql/"."mysql_error.log";
|
||||
elsif ( -f "/var/log/mysql/" . "mysql_error.log" ) {
|
||||
return "/var/log/mysql/" . "mysql_error.log";
|
||||
}
|
||||
else {
|
||||
return $file;
|
||||
|
@ -1248,21 +1251,21 @@ sub get_log_file_real_path {
|
|||
|
||||
sub log_file_recommendations {
|
||||
my $fh;
|
||||
$myvar{'log_error'} = $opt{'server-log'} ||
|
||||
get_log_file_real_path( $myvar{'log_error'}, $myvar{'hostname'},
|
||||
$myvar{'log_error'} = $opt{'server-log'}
|
||||
|| get_log_file_real_path( $myvar{'log_error'}, $myvar{'hostname'},
|
||||
$myvar{'datadir'} );
|
||||
|
||||
subheaderprint "Log file Recommendations";
|
||||
if ( "$myvar{'log_error'}" eq "stderr" ) {
|
||||
badprint "log_error is set to $myvar{'log_error'} MT can't read stderr";
|
||||
return
|
||||
return;
|
||||
}
|
||||
elsif ( $myvar{'log_error'} =~ /^(docker|podman|kubectl):(.*)/ ) {
|
||||
open( $fh, '-|', "$1 logs --tail=$maxlines '$2'" )
|
||||
// die "Can't start $1 $!";
|
||||
goodprint "Log from cloud` $myvar{'log_error'} exists";
|
||||
}
|
||||
elsif ($myvar{'log_error'} =~ /^systemd:(.*)/ ) {
|
||||
elsif ( $myvar{'log_error'} =~ /^systemd:(.*)/ ) {
|
||||
open( $fh, '-|', "journalctl -n $maxlines -b -u '$1'" )
|
||||
// die "Can't start journalctl $!";
|
||||
goodprint "Log journal` $myvar{'log_error'} exists";
|
||||
|
@ -1272,7 +1275,7 @@ sub log_file_recommendations {
|
|||
my $size = ( stat $myvar{'log_error'} )[7];
|
||||
infoprint "Log file: "
|
||||
. $myvar{'log_error'} . "("
|
||||
. hr_bytes_rnd( $size ) . ")";
|
||||
. hr_bytes_rnd($size) . ")";
|
||||
|
||||
if ( $size > 0 ) {
|
||||
goodprint "Log file $myvar{'log_error'} is not empty";
|
||||
|
@ -1291,15 +1294,15 @@ sub log_file_recommendations {
|
|||
"Log file $myvar{'log_error'} is empty. Assuming log-rotation. Use --server-log={file} for explicit file";
|
||||
return;
|
||||
}
|
||||
if ( ! open( $fh, '<', $myvar{'log_error'} ) ) {
|
||||
if ( !open( $fh, '<', $myvar{'log_error'} ) ) {
|
||||
badprint "Log file $myvar{'log_error'} isn't readable.";
|
||||
return;
|
||||
}
|
||||
goodprint "Log file $myvar{'log_error'} is readable.";
|
||||
|
||||
if ( $maxlines * 80 < $size ) {
|
||||
seek( $fh, -$maxlines * 80, 2);
|
||||
<$fh> ; # discard line fragment
|
||||
seek( $fh, -$maxlines * 80, 2 );
|
||||
<$fh>; # discard line fragment
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
@ -1316,7 +1319,8 @@ sub log_file_recommendations {
|
|||
while ( my $logLi = <$fh> ) {
|
||||
chomp $logLi;
|
||||
$numLi++;
|
||||
debugprint "$numLi: $logLi" if $logLi =~ /warning|error/i and $logLi !~ /Logging to/;
|
||||
debugprint "$numLi: $logLi"
|
||||
if $logLi =~ /warning|error/i and $logLi !~ /Logging to/;
|
||||
$nbErrLog++ if $logLi =~ /error/i and $logLi !~ /Logging to/;
|
||||
$nbWarnLog++ if $logLi =~ /warning/i;
|
||||
push @lastShutdowns, $logLi
|
||||
|
@ -1797,6 +1801,7 @@ sub security_recommendations {
|
|||
}
|
||||
|
||||
my $PASS_COLUMN_NAME = 'password';
|
||||
|
||||
# New table schema available since mysql-5.7 and mariadb-10.2
|
||||
# But need to be checked
|
||||
if ( $myvar{'version'} =~ /5\.7|10\.[2-5]\..*MariaDB*/ ) {
|
||||
|
@ -1804,14 +1809,14 @@ sub security_recommendations {
|
|||
`$mysqlcmd $mysqllogin -Bse "SELECT 1 FROM information_schema.columns WHERE TABLE_SCHEMA = 'mysql' AND TABLE_NAME = 'user' AND COLUMN_NAME = 'password'" 2>>/dev/null`;
|
||||
my $authstring_column_exists =
|
||||
`$mysqlcmd $mysqllogin -Bse "SELECT 1 FROM information_schema.columns WHERE TABLE_SCHEMA = 'mysql' AND TABLE_NAME = 'user' AND COLUMN_NAME = 'authentication_string'" 2>>/dev/null`;
|
||||
if ($password_column_exists && $authstring_column_exists) {
|
||||
if ( $password_column_exists && $authstring_column_exists ) {
|
||||
$PASS_COLUMN_NAME =
|
||||
"IF(plugin='mysql_native_password', authentication_string, password)";
|
||||
}
|
||||
elsif ($authstring_column_exists) {
|
||||
$PASS_COLUMN_NAME = 'authentication_string';
|
||||
}
|
||||
elsif (!$password_column_exists) {
|
||||
elsif ( !$password_column_exists ) {
|
||||
infoprint "Skipped due to none of known auth columns exists";
|
||||
return;
|
||||
}
|
||||
|
@ -1831,7 +1836,10 @@ sub security_recommendations {
|
|||
. " anonymous accounts." );
|
||||
foreach my $line ( sort @mysqlstatlist ) {
|
||||
chomp($line);
|
||||
badprint "User " . $line . " is an anonymous account. Remove with DROP USER " . $line . ";";
|
||||
badprint "User "
|
||||
. $line
|
||||
. " is an anonymous account. Remove with DROP USER "
|
||||
. $line . ";";
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
@ -1844,7 +1852,7 @@ sub security_recommendations {
|
|||
}
|
||||
|
||||
# Looking for Empty Password
|
||||
if ( mysql_version_ge(10, 4) ) {
|
||||
if ( mysql_version_ge( 10, 4 ) ) {
|
||||
@mysqlstatlist = select_array
|
||||
q{SELECT CONCAT(QUOTE(user), '@', QUOTE(host)) FROM mysql.global_priv WHERE
|
||||
user != ''
|
||||
|
@ -1862,7 +1870,9 @@ q{SELECT CONCAT(QUOTE(user), '@', QUOTE(host)) FROM mysql.global_priv WHERE
|
|||
foreach my $line ( sort @mysqlstatlist ) {
|
||||
chomp($line);
|
||||
badprint "User '" . $line . "' has no password set.";
|
||||
push (@generalrec, "Set up a Secure Password for $line user: SET PASSWORD FOR $line = PASSWORD('secure_password');")
|
||||
push( @generalrec,
|
||||
"Set up a Secure Password for $line user: SET PASSWORD FOR $line = PASSWORD('secure_password');"
|
||||
);
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
@ -1887,7 +1897,9 @@ q{SELECT CONCAT(QUOTE(user), '@', QUOTE(host)) FROM mysql.global_priv WHERE
|
|||
foreach my $line ( sort @mysqlstatlist ) {
|
||||
chomp($line);
|
||||
badprint "User " . $line . " has user name as password.";
|
||||
push (@generalrec, "Set up a Secure Password for $line user: SET PASSWORD FOR $line = PASSWORD('secure_password');");
|
||||
push( @generalrec,
|
||||
"Set up a Secure Password for $line user: SET PASSWORD FOR $line = PASSWORD('secure_password');"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1896,12 +1908,16 @@ q{SELECT CONCAT(QUOTE(user), '@', QUOTE(host)) FROM mysql.global_priv WHERE
|
|||
if (@mysqlstatlist) {
|
||||
foreach my $line ( sort @mysqlstatlist ) {
|
||||
chomp($line);
|
||||
my $luser = (split /@/, $line)[0];
|
||||
badprint "User '" . $line. "' does not specify hostname restrictions.";
|
||||
my $luser = ( split /@/, $line )[0];
|
||||
badprint "User '" . $line
|
||||
. "' does not specify hostname restrictions.";
|
||||
push( @generalrec,
|
||||
"Restrict Host for $luser\@% to $luser\@LimitedIPRangeOrLocalhost" );
|
||||
"Restrict Host for $luser\@% to $luser\@LimitedIPRangeOrLocalhost"
|
||||
);
|
||||
push( @generalrec,
|
||||
"RENAME USER $luser\@'%' TO " . $luser. "\@LimitedIPRangeOrLocalhost;" );
|
||||
"RENAME USER $luser\@'%' TO "
|
||||
. $luser
|
||||
. "\@LimitedIPRangeOrLocalhost;" );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1945,7 +1961,11 @@ q{SELECT CONCAT(QUOTE(user), '@', QUOTE(host)) FROM mysql.global_priv WHERE
|
|||
badprint "User '" . $line
|
||||
. "' is using weak password: $pass in a lower, upper or capitalize derivative version.";
|
||||
|
||||
push (@generalrec, "Set up a Secure Password for $line user: SET PASSWORD FOR '" . (split /@/, $line)[0] . "'\@'".(split /@/, $line)[1]."' = PASSWORD('secure_password');");
|
||||
push( @generalrec,
|
||||
"Set up a Secure Password for $line user: SET PASSWORD FOR '"
|
||||
. ( split /@/, $line )[0] . "'\@'"
|
||||
. ( split /@/, $line )[1]
|
||||
. "' = PASSWORD('secure_password');" );
|
||||
$nbins++;
|
||||
}
|
||||
}
|
||||
|
@ -1954,7 +1974,9 @@ q{SELECT CONCAT(QUOTE(user), '@', QUOTE(host)) FROM mysql.global_priv WHERE
|
|||
}
|
||||
}
|
||||
if ( $nbins > 0 ) {
|
||||
push( @generalrec, $nbins . " user(s) used basic or weak password from basic dictionary." );
|
||||
push( @generalrec,
|
||||
$nbins
|
||||
. " user(s) used basic or weak password from basic dictionary." );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2036,14 +2058,22 @@ sub validate_mysql_version {
|
|||
$mysqlverminor ||= 0;
|
||||
$mysqlvermicro ||= 0;
|
||||
|
||||
if ( mysql_version_eq(8) or mysql_version_eq(5, 6) or mysql_version_eq(5, 7)
|
||||
or mysql_version_eq(10, 2) or mysql_version_eq(10, 3) or mysql_version_eq(10, 4)
|
||||
or mysql_version_eq(10, 5) )
|
||||
if ( mysql_version_eq(8)
|
||||
or mysql_version_eq( 5, 6 )
|
||||
or mysql_version_eq( 5, 7 )
|
||||
or mysql_version_eq( 10, 2 )
|
||||
or mysql_version_eq( 10, 3 )
|
||||
or mysql_version_eq( 10, 4 )
|
||||
or mysql_version_eq( 10, 5 ) )
|
||||
{
|
||||
goodprint "Currently running supported MySQL version " . $myvar{'version'} . "";
|
||||
goodprint "Currently running supported MySQL version "
|
||||
. $myvar{'version'} . "";
|
||||
return;
|
||||
}
|
||||
if ( mysql_version_ge( 5 ) or mysql_version_ge( 4 ) or mysql_version_eq(10, 0) ) {
|
||||
if ( mysql_version_ge(5)
|
||||
or mysql_version_ge(4)
|
||||
or mysql_version_eq( 10, 0 ) )
|
||||
{
|
||||
badprint "Your MySQL version "
|
||||
. $myvar{'version'}
|
||||
. " is EOL software! Upgrade soon!";
|
||||
|
@ -2739,10 +2769,11 @@ sub calculations {
|
|||
$myvar{'innodb_log_files_in_group'} * 100 /
|
||||
$myvar{'innodb_buffer_pool_size'} );
|
||||
}
|
||||
if( !defined $myvar{'innodb_buffer_pool_size'}) {
|
||||
if ( !defined $myvar{'innodb_buffer_pool_size'} ) {
|
||||
$mycalc{'innodb_log_size_pct'} = 0;
|
||||
$myvar{'innodb_buffer_pool_size'} = 0;
|
||||
}
|
||||
|
||||
# InnoDB Buffer pool read cache efficiency
|
||||
(
|
||||
$mystat{'Innodb_buffer_pool_read_requests'},
|
||||
|
@ -3016,7 +3047,7 @@ sub mysql_stats {
|
|||
|
||||
#return;
|
||||
}
|
||||
elsif ( $myvar{'query_cache_size'} < 1
|
||||
elsif ($myvar{'query_cache_size'} < 1
|
||||
or $myvar{'query_cache_type'} eq "OFF" )
|
||||
{
|
||||
goodprint
|
||||
|
@ -3113,10 +3144,12 @@ sub mysql_stats {
|
|||
"join_buffer_size (> "
|
||||
. hr_bytes( $myvar{'join_buffer_size'} )
|
||||
. ", or always use indexes with JOINs)" );
|
||||
push( @generalrec,
|
||||
"We will suggest raising the 'join_buffer_size' until JOINs not using indexes are found.
|
||||
push(
|
||||
@generalrec,
|
||||
"We will suggest raising the 'join_buffer_size' until JOINs not using indexes are found.
|
||||
See https://dev.mysql.com/doc/internals/en/join-buffer-size.html
|
||||
(specially the conclusions at the bottom of the page).");
|
||||
(specially the conclusions at the bottom of the page)."
|
||||
);
|
||||
}
|
||||
else {
|
||||
goodprint "No joins without indexes";
|
||||
|
@ -3274,20 +3307,31 @@ sub mysql_stats {
|
|||
}
|
||||
|
||||
# Table definition cache
|
||||
my $nbtables=select_one('SELECT COUNT(*) FROM information_schema.tables');
|
||||
my $nbtables = select_one('SELECT COUNT(*) FROM information_schema.tables');
|
||||
$mycalc{'total_tables'} = $nbtables;
|
||||
if ( defined $myvar{'table_definition_cache'} ) {
|
||||
if ( $myvar{'table_definition_cache'} == -1 ) {
|
||||
infoprint ("table_definition_cache(".$myvar{'table_definition_cache'} .") is in autosizing mode");
|
||||
} elsif ($myvar{'table_definition_cache'} < $nbtables ) {
|
||||
badprint "table_definition_cache(".$myvar{'table_definition_cache'} .") is lower than number of tables($nbtables) ";
|
||||
infoprint( "table_definition_cache("
|
||||
. $myvar{'table_definition_cache'}
|
||||
. ") is in autosizing mode" );
|
||||
}
|
||||
elsif ( $myvar{'table_definition_cache'} < $nbtables ) {
|
||||
badprint "table_definition_cache("
|
||||
. $myvar{'table_definition_cache'}
|
||||
. ") is lower than number of tables($nbtables) ";
|
||||
push( @adjvars,
|
||||
"table_definition_cache(".$myvar{'table_definition_cache'} .") > " . $nbtables . " or -1 (autosizing if supported)" );
|
||||
"table_definition_cache("
|
||||
. $myvar{'table_definition_cache'} . ") > "
|
||||
. $nbtables
|
||||
. " or -1 (autosizing if supported)" );
|
||||
}
|
||||
else {
|
||||
goodprint "table_definition_cache(".$myvar{'table_definition_cache'} .") is upper than number of tables($nbtables)";
|
||||
goodprint "table_definition_cache("
|
||||
. $myvar{'table_definition_cache'}
|
||||
. ") is upper than number of tables($nbtables)";
|
||||
}
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
infoprint "No table_definition_cache variable found.";
|
||||
}
|
||||
|
||||
|
@ -3375,10 +3419,11 @@ sub mysql_stats {
|
|||
# Recommendations for MyISAM
|
||||
sub mysql_myisam {
|
||||
subheaderprint "MyISAM Metrics";
|
||||
if (mysql_version_ge(8) and mysql_version_le(10) ) {
|
||||
if ( mysql_version_ge(8) and mysql_version_le(10) ) {
|
||||
infoprint "MyISAM Metrics are disabled on last MySQL versions.";
|
||||
return;
|
||||
}
|
||||
|
||||
# Key buffer usage
|
||||
if ( defined( $mycalc{'pct_key_buffer_used'} ) ) {
|
||||
if ( $mycalc{'pct_key_buffer_used'} < 90 ) {
|
||||
|
@ -3416,8 +3461,7 @@ sub mysql_myisam {
|
|||
# Key buffer
|
||||
if ( !defined( $mycalc{'total_myisam_indexes'} ) ) {
|
||||
push( @generalrec,
|
||||
"Unable to calculate MyISAM index size on MySQL server < 5.0.0"
|
||||
);
|
||||
"Unable to calculate MyISAM index size on MySQL server < 5.0.0" );
|
||||
}
|
||||
else {
|
||||
if ( $myvar{'key_buffer_size'} < $mycalc{'total_myisam_indexes'}
|
||||
|
@ -4204,7 +4248,12 @@ sub mysqsl_pfs {
|
|||
# Unused Indexes
|
||||
subheaderprint "Performance schema: Unused indexes";
|
||||
$nbL = 1;
|
||||
for my $lQuery ( select_array("select \* from sys.schema_unused_indexes where object_schema not in ('performance_schema')" )) {
|
||||
for my $lQuery (
|
||||
select_array(
|
||||
"select \* from sys.schema_unused_indexes where object_schema not in ('performance_schema')"
|
||||
)
|
||||
)
|
||||
{
|
||||
infoprint " +-- $nbL: $lQuery";
|
||||
$nbL++;
|
||||
}
|
||||
|
@ -5053,13 +5102,11 @@ sub mariadb_aria {
|
|||
subheaderprint "Aria Metrics";
|
||||
|
||||
# Aria
|
||||
if ( ! defined $myvar{'have_aria'} )
|
||||
{
|
||||
if ( !defined $myvar{'have_aria'} ) {
|
||||
infoprint "Aria Storage Engine not available.";
|
||||
return;
|
||||
}
|
||||
if ( $myvar{'have_aria'} ne "YES" )
|
||||
{
|
||||
if ( $myvar{'have_aria'} ne "YES" ) {
|
||||
infoprint "Aria Storage Engine is disabled.";
|
||||
return;
|
||||
}
|
||||
|
@ -5557,21 +5604,24 @@ sub mysql_innodb {
|
|||
|
||||
# InnoDB
|
||||
unless ( defined $myvar{'have_innodb'}
|
||||
&& $myvar{'have_innodb'} eq "YES")
|
||||
&& $myvar{'have_innodb'} eq "YES" )
|
||||
{
|
||||
infoprint "InnoDB is disabled.";
|
||||
if ( mysql_version_ge( 5, 5 ) ) {
|
||||
my $defengine = 'InnoDB';
|
||||
$defengine = $myvar{'default_storage_engine'} if defined($myvar{'default_storage_engine'});
|
||||
$defengine = $myvar{'default_storage_engine'}
|
||||
if defined( $myvar{'default_storage_engine'} );
|
||||
badprint
|
||||
"InnoDB Storage engine is disabled. $defengine is the default storage engine" if $defengine eq 'InnoDB';
|
||||
"InnoDB Storage engine is disabled. $defengine is the default storage engine"
|
||||
if $defengine eq 'InnoDB';
|
||||
infoprint
|
||||
"InnoDB Storage engine is disabled. $defengine is the default storage engine" if $defengine ne 'InnoDB';
|
||||
"InnoDB Storage engine is disabled. $defengine is the default storage engine"
|
||||
if $defengine ne 'InnoDB';
|
||||
}
|
||||
return;
|
||||
}
|
||||
infoprint "InnoDB is enabled.";
|
||||
if (! defined $enginestats{'InnoDB'} ) {
|
||||
if ( !defined $enginestats{'InnoDB'} ) {
|
||||
if ( $opt{skipsize} eq 1 ) {
|
||||
infoprint "Skipped due to --skipsize option";
|
||||
return;
|
||||
|
@ -5675,10 +5725,10 @@ sub mysql_innodb {
|
|||
)
|
||||
. ") if possible, so InnoDB total log files size equals to 25% of buffer pool size."
|
||||
);
|
||||
if (mysql_version_le(5 ,6 , 2)) {
|
||||
push(
|
||||
@generalrec,
|
||||
"For MySQL 5.6.2 and lower, Max combined innodb_log_file_size should have a ceiling of (4096MB / log files in group) - 1MB.");
|
||||
if ( mysql_version_le( 5, 6, 2 ) ) {
|
||||
push( @generalrec,
|
||||
"For MySQL 5.6.2 and lower, Max combined innodb_log_file_size should have a ceiling of (4096MB / log files in group) - 1MB."
|
||||
);
|
||||
}
|
||||
push( @generalrec,
|
||||
"Before changing innodb_log_file_size and/or innodb_log_files_in_group read this: https://bit.ly/2TcGgtU"
|
||||
|
@ -5693,7 +5743,9 @@ sub mysql_innodb {
|
|||
}
|
||||
|
||||
# InnoDB Buffer Pool Instances (MySQL 5.6.6+)
|
||||
if ( not mysql_version_ge(10, 5) and defined( $myvar{'innodb_buffer_pool_instances'} ) ) {
|
||||
if ( not mysql_version_ge( 10, 5 )
|
||||
and defined( $myvar{'innodb_buffer_pool_instances'} ) )
|
||||
{
|
||||
|
||||
# Bad Value if > 64
|
||||
if ( $myvar{'innodb_buffer_pool_instances'} > 64 ) {
|
||||
|
@ -5727,6 +5779,7 @@ sub mysql_innodb {
|
|||
goodprint "InnoDB buffer pool instances: "
|
||||
. $myvar{'innodb_buffer_pool_instances'} . "";
|
||||
}
|
||||
|
||||
# InnoDB Buffer Pool Size < 1Go
|
||||
}
|
||||
else {
|
||||
|
@ -6053,8 +6106,9 @@ sub mysql_tables {
|
|||
"Skip Database metrics from information schema missing in this version";
|
||||
return;
|
||||
}
|
||||
if (mysql_version_ge(8) and not mysql_version_eq(10)) {
|
||||
infoprint "MySQL and Percona version 8 and greater have remove PROCEDURE ANALYSE feature"
|
||||
if ( mysql_version_ge(8) and not mysql_version_eq(10) ) {
|
||||
infoprint
|
||||
"MySQL and Percona version 8 and greater have remove PROCEDURE ANALYSE feature";
|
||||
}
|
||||
foreach (@dblist) {
|
||||
my $dbname = $_;
|
||||
|
@ -6080,21 +6134,25 @@ sub mysql_tables {
|
|||
infoprint " +-- Column $tbname.$_:";
|
||||
my $current_type =
|
||||
uc($ctype) . ( $isnull eq 'NO' ? " NOT NULL" : "" );
|
||||
my $optimal_type='';
|
||||
my $optimal_type = '';
|
||||
$optimal_type = select_str_g( "Optimal_fieldtype",
|
||||
"SELECT \\`$_\\` FROM \\`$dbname\\`.\\`$tbname\\` PROCEDURE ANALYSE(100000)"
|
||||
) unless (mysql_version_ge(8) and not mysql_version_eq(10));
|
||||
) unless ( mysql_version_ge(8) and not mysql_version_eq(10) );
|
||||
if ( $optimal_type eq '' ) {
|
||||
infoprint " Current Fieldtype: $current_type";
|
||||
|
||||
#infoprint " Optimal Fieldtype: Not available";
|
||||
}
|
||||
elsif ( $current_type ne $optimal_type and $current_type !~ /.*DATETIME.*/ and $current_type !~ /.*TIMESTAMP.*/) {
|
||||
elsif ( $current_type ne $optimal_type
|
||||
and $current_type !~ /.*DATETIME.*/
|
||||
and $current_type !~ /.*TIMESTAMP.*/ )
|
||||
{
|
||||
infoprint " Current Fieldtype: $current_type";
|
||||
if ($optimal_type =~ /.*ENUM\(.*/ ) {
|
||||
$optimal_type ="ENUM( ... )";
|
||||
if ( $optimal_type =~ /.*ENUM\(.*/ ) {
|
||||
$optimal_type = "ENUM( ... )";
|
||||
}
|
||||
infoprint " Optimal Fieldtype: $optimal_type ";
|
||||
if ($optimal_type !~ /.*ENUM\(.*/ ) {
|
||||
if ( $optimal_type !~ /.*ENUM\(.*/ ) {
|
||||
badprint
|
||||
"Consider changing type for column $_ in table $dbname.$tbname";
|
||||
push( @generalrec,
|
||||
|
|
2261
vulnerabilities.csv
2261
vulnerabilities.csv
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue