Skip to content

Using option --default-time-zone at first run makes mysql_install_db script fail #543

@yannoff

Description

@yannoff

When using option --default-time-zone in docker command, the MySQL initialization script fails, because the timezone tables haven't been populated yet when mysql_install_db is invoked.

Here is an example, using the following docker-compose configuration:

#docker-compose.yml
version: '3'
services:
    mysql:
        image: mysql:5.5
        environment:
            MYSQL_DATABASE: acme
            MYSQL_ROOT_PASSWORD: xxxyyy
        command:
             - mysqld
             - "--character-set-server=utf8mb4"
             - "--skip-character-set-client-handshake"
             - "--collation-server=utf8mb4_unicode_ci"
             - "--default-time-zone=Europe/Paris"

And here is the resulting log:

Attaching to webapp_mysql_1
mysql_1        | Initializing database
mysql_1        | 190219 11:01:18 [Note] Ignoring --secure-file-priv value as server is running with --bootstrap.
mysql_1        | 190219 11:01:18 [Note] /usr/local/mysql/bin/mysqld (mysqld 5.5.62) starting as process 68 ...
mysql_1        | 190219 11:01:18 [ERROR] Fatal error: Illegal or unknown default time zone 'Europe/Paris'
mysql_1        | 
mysql_1        | Installation of system tables failed!  Examine the logs in
mysql_1        | /var/lib/mysql/ for more information.
mysql_1        | 
mysql_1        | You can try to start the mysqld daemon with:
mysql_1        | 
mysql_1        |     shell> /usr/local/mysql/bin/mysqld --skip-grant &
mysql_1        | 
mysql_1        | and use the command line tool /usr/local/mysql/bin/mysql
mysql_1        | to connect to the mysql database and look at the grant tables:
mysql_1        | 
mysql_1        |     shell> /usr/local/mysql/bin/mysql -u root mysql
mysql_1        |     mysql> show tables
mysql_1        | 
mysql_1        | Try 'mysqld --help' if you have problems with paths.  Using --log
mysql_1        | gives you a log in /var/lib/mysql/ that may be helpful.
mysql_1        | 
mysql_1        | Please consult the MySQL manual section
mysql_1        | 'Problems running mysql_install_db', and the manual section that
mysql_1        | describes problems on your OS.  Another information source are the
mysql_1        | MySQL email archives available at http://lists.mysql.com/.
mysql_1        | 
mysql_1        | Please check all of the above before submitting a bug report
mysql_1        | at http://bugs.mysql.com/
mysql_1        | 

I think this might have been introduced by #358

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions