Bug #88065 At initialization, mysqld fails to start with log `[ERROR] Failed to start mysql
Submitted: 12 Oct 2017 1:10 Modified: 17 Nov 2017 7:35
Reporter: Junwoo Park Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Package Repos Severity:S1 (Critical)
Version:MySQL Docker Image 8.0.3-1.1.1 OS:Ubuntu (16.04.2 LTS)
Assigned to: Lars Tangvald CPU Architecture:Any

[12 Oct 2017 1:10] Junwoo Park
Description:
After the Database is initialized [at line 77](https://github.com/mysql/mysql-docker/blob/mysql-server/8.0/docker-entrypoint.sh#L77), mysqld fails to start with log `[ERROR] Failed to start mysqld daemon.`

As a result, the database is not initialized properly with the given environment variables.

This behaviour is not reproduced from another host such as Mac OS X. 

I used the docker image `mysql/mysql-server 8.0` from https://hub.docker.com/r/mysql/mysql-server/.

How to repeat:
Use env file on dockeer-compose.yml to provide the default environment variables MYSQL_ROOT_PASSWORD, MYSQL_DATABASE, MYSQL_PASSWORD, MYSQL_USER. 

Run docker-compose up.
[12 Oct 2017 1:11] Junwoo Park
The log from the docker container.

Attachment: aws_bug.log (application/octet-stream, text), 8.64 KiB.

[12 Oct 2017 10:12] Lars Tangvald
Hi,

Having trouble reproducing this on Ubuntu 16.04

Are those variables the only ones defined in the environment file?
If it's possible, it might be helpful if you could supply the yml and env files you used.

Also, which version of docker-compose are you using?
[17 Oct 2017 7:35] MySQL Verification Team
Please see Lars questions. Thanks.
[2 Nov 2017 10:48] Alban TUAL
Hi,
I also have this trouble with a personal dockerfile which look like this :

FROM debian:wheezy
...
RUN apt-get update DEBIAN_FRONTEND=noninteractive apt-get install -y mysql-server
...
RUN service mysql restart && mysql -uroot < /var/sql/install.sql

Mysql failed to start.
To make it work, i have to move every mysql commands into the CMD line at the end of my dockerfile after a "chmod -R 700 /var/lib/mysql/*"

If i do this chmod command sooner in a RUN docker command  it doesn't work too, very strange behaviour.
[18 Nov 2017 1:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
[13 Nov 2018 21:52] Sam Korn
Hello, I know it has been almost a year since this bug was filed, but I have been running into this issue all day!

I am running Ubuntu 18.04 on a Digital Ocean VPS.
Docker version 18.06.1-ce, build e68fc7a
docker-compose version 1.23.1, build b02f1306

MySQL Version: mysql/mysql-server:latest and mysql/mysql-server:8.0.13-1.1.8

Piece of Docker-Compose File:

  babylon-db:
    # build:
    #   context: ./Babylon-DB
    image: mysql/mysql-server:8.0.13-1.1.8
    container_name: mysql1
    environment:
      - "DUMP_DATE=2018-11-13"
      - MYSQL_ROOT_PASSWORD="defmysql"
    ports:
      - "3306:3306"
    networks:
      - baby-net
    volumes:
      - /media/dbbackup/:/mnt:rw
      - /home/babylon/Babylon-Cloud/Babylon-DB/scripts/:/home/:ro
      - /home/babylon/Babylon-Cloud/Babylon-DB/sql/:/docker-entrypoint-initdb.d/:ro

After starting the container, I know there is an issue occuring when the line:
 
[Warning] [MY-010453] [Server] root@localhost is created with an empty password ! Please consider switching off the --initialize-insecure option.

It finally fails at: 
[ERROR] [MY-010946] [Server] Failed to start mysqld daemon. Check mysqld error log.
However when I do: 

docker cp mysql1:/var/log/mysqld.log .
cat mysqld.log

The mysqld.log file is empty... leaving my debugging hanging...

I was able to run the docker mysql image tag 5.7, and was able to start up a database, but then couldnt import my database image, which came from mysql 8.

I will be around all week working on it, so I hope someone has an idea... Im sure its not too complicated, this is the only bug report that matches my issue exactly.