Comment 20 for bug 1623440

Revision history for this message
Paolo Montrasio (paolo-paolomontrasio) wrote :

I agree with #18, still this is the first bug returned by Google with this error message. I have the same symptom as #19

$ sudo tail /var/log/mysql/error.log

2018-07-11T08:34:27.647514Z 0 [Note] InnoDB: Buffer pool(s) load completed at 180711 10:34:27
2018-07-11T08:34:27.647546Z 0 [Warning] Failed to set up SSL because of the following SSL library error: SSL context is not usable without certificate and private key
2018-07-11T08:34:27.647559Z 0 [Note] Server hostname (bind-address): '127.0.0.1'; port: 3306
2018-07-11T08:34:27.647569Z 0 [Note] - '127.0.0.1' resolves to '127.0.0.1';
2018-07-11T08:34:27.647599Z 0 [Note] Server socket created on IP: '127.0.0.1'.
2018-07-11T08:34:27.656279Z 0 [Note] Event Scheduler: Loaded 0 events
2018-07-11T08:34:27.656431Z 0 [Note] /usr/sbin/mysqld: ready for connections.
Version: '5.7.22-0ubuntu0.16.04.1' socket: '/var/run/mysqld/mysqld.sock' port: 3306 (Ubuntu)
2018-07-11T08:34:28.342474Z 2 [Note] Access denied for user 'root'@'localhost' (using password: NO)
2018-07-11T08:34:28.348736Z 3 [Note] Access denied for user 'debian-sys-maint'@'localhost' (using password: YES)

$ sudo cat /etc/mysql/debian.cnf

# Automatically generated for Debian scripts. DO NOT TOUCH!
[client]
host = localhost
user = debian-sys-maint
password = some password
socket = /var/run/mysqld/mysqld.sock
[mysql_upgrade]
host = localhost
user = debian-sys-maint
password = the same password of the client section
socket = /var/run/mysqld/mysqld.sock

$ mysql -uroot -p

mysql> select User,Host from mysql.user;
mysql> select User,Host,authentication_string from mysql.user;
+--------------------+-----------+-------------------------------------------+
| User | Host | authentication_string |
+--------------------+-----------+-------------------------------------------+
| root | localhost | *hex random string |
| mysql.session | localhost | *THISISNOTAVALIDPASSWORDTHATCANBEUSEDHERE |
| mysql.sys | localhost | *THISISNOTAVALIDPASSWORDTHATCANBEUSEDHERE |
| debian-sys-maint | localhost | *different hex random string |
+--------------------+-----------+-------------------------------------------+

So the user is there, the password must be wrong.

mysql> alter user 'debian-sys-maint'@'localhost' identified by 'the password in debian.cnf';
Query OK, 0 rows affected (0.00 sec)

mysql> select User,Host,authentication_string from mysql.user where User = 'debian-sys-maint';
+------------------+-----------+-------------------------------------------+
| User | Host | authentication_string |
+------------------+-----------+-------------------------------------------+
| debian-sys-maint | localhost | *the same hex string, it didn't change |
+------------------+-----------+-------------------------------------------+

and the reason is that the password was already correct

mysql> select password('the password in debian.cnf');
+-------------------------------------------+
| password('the password in debian.cnf') |
+-------------------------------------------+
| *the hex string is both queries on user |
+-------------------------------------------+

The problem is that the password doesn't work:

$ mysql -u debian-sys-maint -h localhost -p
Enter password: <the password in debian.cnf and in mysql.user>
ERROR 1045 (28000): Access denied for user 'debian-sys-maint'@'localhost' (using password: YES)

which is exactly the message in error.log