mysql_secure_installation/mysqladmin cannot set password when auth_socket is enabled
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MySQL Server |
Unknown
|
Unknown
|
|||
mysql-5.7 (Ubuntu) |
Triaged
|
Low
|
Unassigned |
Bug Description
If MySQL 5.7 is installed with an empty password, UNIX socket authentication will be enabled for the root user. If the user then tries to set a root password using mysql_secure_
Upstream bug: http://
To reproduce:
1. sudo apt-get install mysql-server (noninteractive or enter empty password)
2. sudo mysqladmin -uroot password 'mypass' (seems to succeed)
3. mysql -uroot -pmypass (access denied)
Workarounds:
a) Set plugin after installation:
User needs to manually set auth plugin back to password with an sql:
1. Log in with sudo mysql
2. run «ALTER USER 'root'@'localhost' IDENTIFIED WITH 'mysql_
Or from command line:
sudo mysql -e "ALTER USER 'root'@'localhost' IDENTIFIED WITH 'mysql_
b) Set password before installation:
It's possible to script the answer to the root password query using debconf-
1. debconf-
mysql-server-5.7 mysql-server/
mysql-server-5.7 mysql-server/
EOT
2. apt-get install mysql-server
---
Other people have encountered the same problem:
http://
Changed in mysql-5.7 (Ubuntu): | |
importance: | Undecided → High |
summary: |
- mysql_secure_installation locks out root database user + mysql_secure_installation/mysqladmin cannot set password when + auth_socket is enabled |
description: | updated |
description: | updated |
Changed in mysql-5.7 (Ubuntu): | |
status: | New → Confirmed |
tags: | added: bionic |
FYI, if you have any difficulty reproducing this issue, I actually installed the mysql-server package using Puppet (version 3.8.5), not manually with apt-get. The puppet manifest file contains simply:
package { 'mysql-server':
ensure => 'installed',
}
To run it, simply place the above lines into a file (say) "build.pp" and run this puppet command:
$ sudo puppet apply build.pp
I suspect this may be relevant.