Bug #78170 MySQL 5.6 Docker Image No Longer Respects MYSQL_ALLOW_EMPTY_PASSWORD
Submitted: 21 Aug 2015 21:01 Modified: 26 Aug 2015 13:03
Reporter: N S Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Package Repos Severity:S3 (Non-critical)
Version: OS:Any
Assigned to: Lars Tangvald CPU Architecture:Any

[21 Aug 2015 21:01] N S
Description:
When starting a new container from mysql/mysql-server:latest, using MYSQL_ALLOW_EMPTY_PASSWORD now fails and does not create databases or users. I believe it has to do with this commit: https://github.com/mysql/mysql-docker/commit/14f165596ea8808dfeb2131f092aabe61c967225

It introduced a new line around Line 58:

mysql+=( -p"${MYSQL_ROOT_PASSWORD}" )

I believe this line is forcing an empty password, as opposed to "USING PASSWORD: NO". This breaks the empty root password behavior that you would expect from not having a root password.

How to repeat:
Run a Docker container with the following environment variables:

MYSQL_ALLOW_EMPTY_PASSWORD=yes
MYSQL_USER=user
MYSQL_PASSWORD=password
MYSQL_DATABASE=database

The database and user will not be created.
[26 Aug 2015 13:03] Lars Tangvald
The line
mysql+=( -p"${MYSQL_ROOT_PASSWORD}" )
will now only be executed if MYSQL_ROOT_PASSWORD is set
[6 Oct 2017 4:27] Basavaraj K N
Hi, though this is an very old issue, this seems to be happening again with the latest version of the Docker images

I am not able to initialise the DB and run it if used EMPTY password

Can we get some help