mysqltuner looks for old 'password' field, not 'authentication_string'

Bug #1634613 reported by Nick
28
This bug affects 5 people
Affects Status Importance Assigned to Milestone
mysqltuner (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

MySQL 5.7 changed the 'password' field to 'authentication_string' which breaks mysqltuner. When running mysqltuner 1.6.0 on 16.10 (which includes MySQL 5.7) you get the error:
ERROR 1054 (42S22) at line 1: Unknown column 'password' in 'where clause'

This appears to be fixed in mysqltuner 1.6.18

Nick (kg6nmp)
description: updated
Revision history for this message
Roland Steinbach (webstoney) wrote :

This affects also 16.04.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in mysqltuner (Ubuntu):
status: New → Confirmed
Revision history for this message
Matthias Baur (matthiasbaur) wrote :

Any change this gets fixed soon?

Revision history for this message
Thomas Antepoth (ta-ubuntu-antepoth) wrote :

Hi folks,

trivial patch here

diff -u mysqltuner.orig mysqltuner
--- mysqltuner.orig 2019-09-13 05:16:01.221572477 +0200
+++ mysqltuner 2019-09-13 05:17:37.479446200 +0200
@@ -1266,7 +1266,7 @@

     # Looking for Empty Password
     @mysqlstatlist = select_array
-"SELECT CONCAT(user, '\@', host) FROM mysql.user WHERE password = '' OR password IS NULL";
+"SELECT CONCAT(user, '\@', host) FROM mysql.user WHERE authentication_string = '' OR authentication_string IS NULL";
     if (@mysqlstatlist) {
         foreach my $line ( sort @mysqlstatlist ) {
             chomp($line);
@@ -1282,7 +1282,7 @@

     # Looking for User with user/ uppercase /capitalise user as password
     @mysqlstatlist = select_array
-"SELECT CONCAT(user, '\@', host) FROM mysql.user WHERE CAST(password as Binary) = PASSWORD(user) OR CAST(password as Binary) = PASSWORD(UPPER(user)) OR CAST(password as Binary) = PASSWORD(UPPER(LEFT(User, 1)) + SUBSTRING(User, 2, LENGTH(User)))";
+"SELECT CONCAT(user, '\@', host) FROM mysql.user WHERE CAST(authentication_string as Binary) = PASSWORD(user) OR CAST(authentication_string as Binary) = PASSWORD(UPPER(user)) OR CAST(authentication_string as Binary) = PASSWORD(UPPER(LEFT(User, 1)) + SUBSTRING(User, 2, LENGTH(User)))";
     if (@mysqlstatlist) {
         foreach my $line ( sort @mysqlstatlist ) {
             chomp($line);
@@ -1323,11 +1323,11 @@
             # Looking for User with user/ uppercase /capitalise weak password
             @mysqlstatlist =
               select_array
-"SELECT CONCAT(user, '\@', host) FROM mysql.user WHERE password = PASSWORD('"
+"SELECT CONCAT(user, '\@', host) FROM mysql.user WHERE authentication_string = PASSWORD('"
               . $pass
- . "') OR password = PASSWORD(UPPER('"
+ . "') OR authentication_string = PASSWORD(UPPER('"
               . $pass
- . "')) OR password = PASSWORD(UPPER(LEFT('"
+ . "')) OR authentication_string = PASSWORD(UPPER(LEFT('"
               . $pass
               . "', 1)) + SUBSTRING('"
               . $pass

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.