Update mysqltuner.pl
Check to make sure mysql.user has a column called 'password'. Adjust security_recommendations queries accordingly. This should address issues: https://github.com/major/MySQLTuner-perl/issues/427 https://github.com/major/MySQLTuner-perl/issues/441 https://github.com/major/MySQLTuner-perl/issues/442
This commit is contained in:
parent
8206205d57
commit
066acb0940
1 changed files with 7 additions and 1 deletions
|
@ -1738,9 +1738,15 @@ sub security_recommendations {
|
||||||
|
|
||||||
my $PASS_COLUMN_NAME = 'password';
|
my $PASS_COLUMN_NAME = 'password';
|
||||||
if ( $myvar{'version'} =~ /5\.7|10\..*MariaDB*/ ) {
|
if ( $myvar{'version'} =~ /5\.7|10\..*MariaDB*/ ) {
|
||||||
|
my $password_column_exists = `$mysqlcmd $mysqllogin -Bse "SELECT 1 FROM information_schema.columns WHERE TABLE_SCHEMA = 'mysql' AND TABLE_NAME = 'user' AND COLUMN_NAME = 'password'" 2>>/dev/null`;
|
||||||
|
if ($password_column_exists) {
|
||||||
$PASS_COLUMN_NAME =
|
$PASS_COLUMN_NAME =
|
||||||
"IF(plugin='mysql_native_password', authentication_string, password)";
|
"IF(plugin='mysql_native_password', authentication_string, password)";
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
$PASS_COLUMN_NAME = 'authentication_string';
|
||||||
|
}
|
||||||
|
}
|
||||||
debugprint "Password column = $PASS_COLUMN_NAME";
|
debugprint "Password column = $PASS_COLUMN_NAME";
|
||||||
|
|
||||||
# Looking for Anonymous users
|
# Looking for Anonymous users
|
||||||
|
|
Loading…
Reference in a new issue