MySql 8.0.0 and Docker compose problems - mysql

I have specified in my docker-compose.yml the version of MySql 8.0.0 and I am having some issues (that I did not have not specifying the version). What is wrong?
Below you can find my docker-compose.yml and error logs:
version: '3.7'
services:
db:
image: mysql:8.0.0
command: ["--default-authentication-plugin=mysql_native_password"]
ports:
- "3306:3306"
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_USER: symfony
MYSQL_PASSWORD: symfony
php:
build: ./php-fpm
ports:
- "9000:9001"
volumes:
- ./symfony:/var/www/symfony:cached
- ./logs/symfony:/var/www/symfony/var/log:cached
links:
- db
extra_hosts:
- "docker-host.localhost:127.0.0.1"
- "symfony.localhost:172.24.0.5"
nginx:
build: ./nginx
ports:
- "80:80"
links:
- php
volumes:
- ./logs/nginx:/var/log/nginx:cached
- ./symfony:/var/www/symfony:cached
elk:
image: willdurand/elk
ports:
- "81:80"
volumes:
- ./elk/logstash:/etc/logstash:cached
- ./elk/logstash/patterns:/opt/logstash/patterns:cached
- ./logs/symfony:/var/www/symfony/var/log:cached
- ./logs/nginx:/var/log/nginx:cached
and logs:
db_1 | 2019-06-25T11:12:28.129419Z 0 [Warning] TIMESTAMP with
implicit DEFAULT value is deprecated. Please use --
explicit_defaults_for_timestamp server option (see documentation for
more details).
db_1 | 2019-06-25T11:12:28.130523Z 0 [Note] mysqld (mysqld 8.0.0-
dmr) starting as process 1 ...
db_1 | 2019-06-25T11:12:28.134864Z 0 [Note] InnoDB: Using Linux
native AIO
db_1 | 2019-06-25T11:12:28.135137Z 0 [Note] Plugin 'FEDERATED' is
disabled.
db_1 | 2019-06-25T11:12:28.136567Z 1 [Note] InnoDB: PUNCH HOLE
support available
db_1 | 2019-06-25T11:12:28.136614Z 1 [Note] InnoDB: Mutexes and
rw_locks use GCC atomic builtins
db_1 | 2019-06-25T11:12:28.136620Z 1 [Note] InnoDB: Uses event
mutexes
db_1 | 2019-06-25T11:12:28.136623Z 1 [Note] InnoDB: GCC builtin
__atomic_thread_fence() is used for memory barrier
db_1 | 2019-06-25T11:12:28.136626Z 1 [Note] InnoDB: Compressed
tables use zlib 1.2.3
db_1 | 2019-06-25T11:12:28.137151Z 1 [Note] InnoDB: Number of
pools: 1
db_1 | 2019-06-25T11:12:28.137390Z 1 [Note] InnoDB: Using CPU
crc32 instructions
db_1 | 2019-06-25T11:12:28.139057Z 1 [Note] InnoDB: Initializing
buffer pool, total size = 128M, instances = 1, chunk size = 128M
db_1 | libnuma: Warning: /sys not mounted or invalid. Assuming one
node: No such file or directory
db_1 | mbind: Operation not permitted
db_1 | mbind: Operation not permitted
db_1 | mbind: Operation not permitted
db_1 | mbind: Operation not permitted
db_1 | 2019-06-25T11:12:28.150384Z 1 [Note] InnoDB: Completed
initialization of buffer pool
db_1 | 2019-06-25T11:12:28.152938Z 0 [Note] InnoDB: If the mysqld
execution user is authorized, page cleaner thread priority can be
changed. See the man page of setpriority().
db_1 | 2019-06-25T11:12:28.169513Z 1 [ERROR] InnoDB: Unsupported
redo log format. The redo log was created with MySQL 8.0.15. Please
follow the instructions at
http://dev.mysql.com/doc/refman/8.0/en/upgrading-downgrading.html
db_1 | 2019-06-25T11:12:28.169587Z 1 [ERROR] InnoDB: Plugin
initialization aborted with error Generic error
db_1 | 2019-06-25T11:12:28.774335Z 1 [ERROR] Failed to initialize
DD Storage Engine
db_1 | 2019-06-25T11:12:28.774965Z 0 [ERROR] Data Dictionary
initialization failed.
db_1 | 2019-06-25T11:12:28.775132Z 0 [ERROR] Aborting
db_1 |
db_1 | 2019-06-25T11:12:28.775198Z 0 [Note] Binlog end
db_1 | 2019-06-25T11:12:28.775614Z 0 [Note] Shutting down plugin
'InnoDB'
db_1 | 2019-06-25T11:12:28.775986Z 0 [Note] Shutting down plugin
'MyISAM'
db_1 | 2019-06-25T11:12:28.776099Z 0 [Note] Shutting down plugin
'CSV'
db_1 | 2019-06-25T11:12:28.779905Z 0 [Note] mysqld: Shutdown
complete
db_1 |
docker-symfony4-udggui_db_1 exited with code 1

When you did not specify the version as image: mysql, it will use the latest version. At this time the question was raised, it's 8.0.16, see this.
When you specify the version as image: mysql:8.0.0, you just use an old version of mysql.
Unfortunately, this version not compatible with new docker as next:
The server use mbind for NUMA (non-uniform memory access) operations, but Docker blocks this access by default. It's possible to provide a custom profile that allows it, but the syntax of the profile files has changed across Docker versions, so it's kind of messy.
That means, at old time this image work, but now docker upgraded, the mysql image should do corresponding changes. And, 8.0.16 which currently the latest, already made this fix, so it's ok. Detail refers to next discussion:
https://github.com/docker-library/mysql/issues/303
https://github.com/docker-library/mysql/issues/422

Related

Docker mysql container does not allow remote connection

I have an error Access denied for user 'bonus_user'#'my-ip' (using password: YES) when trying to connect from my mysql client to dockerized mysql server on remote machine
My docker-compose file:
bonus_db:
container_name: bonus_db
image: mysql:5.7
command: --default-authentication-plugin=mysql_native_password
restart: unless-stopped
ports:
- "3306:3306"
environment:
MYSQL_USER: bonus_user
MYSQL_PASSWORD: bonus_pass
MYSQL_DATABASE: bonus_db
MYSQL_ROOT_PASSWORD: root_pass
volumes:
- /var/lib/volumes/bonusdata:/var/lib/mysql
Here's also log of container starting:
bonus_db | 2020-11-14 15:06:05+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.7.31-1debian10 started.
bonus_db | 2020-11-14 15:06:05+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
bonus_db | 2020-11-14 15:06:05+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.7.31-1debian10 started.
bonus_db | 2020-11-14T15:06:06.470897Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
bonus_db | 2020-11-14T15:06:06.480712Z 0 [Note] mysqld (mysqld 5.7.31) starting as process 1 ...
bonus_db | 2020-11-14T15:06:06.502124Z 0 [Note] InnoDB: PUNCH HOLE support available
bonus_db | 2020-11-14T15:06:06.504807Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
bonus_db | 2020-11-14T15:06:06.504851Z 0 [Note] InnoDB: Uses event mutexes
bonus_db | 2020-11-14T15:06:06.504878Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
bonus_db | 2020-11-14T15:06:06.504894Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
bonus_db | 2020-11-14T15:06:06.504906Z 0 [Note] InnoDB: Using Linux native AIO
bonus_db | 2020-11-14T15:06:06.505684Z 0 [Note] InnoDB: Number of pools: 1
bonus_db | 2020-11-14T15:06:06.506021Z 0 [Note] InnoDB: Using CPU crc32 instructions
bonus_db | 2020-11-14T15:06:06.522229Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
bonus_db | 2020-11-14T15:06:06.548073Z 0 [Note] InnoDB: Completed initialization of buffer pool
bonus_db | 2020-11-14T15:06:06.554315Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
bonus_db | 2020-11-14T15:06:06.568903Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
bonus_db | 2020-11-14T15:06:06.603166Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
bonus_db | 2020-11-14T15:06:06.605892Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
bonus_db | 2020-11-14T15:06:06.654737Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
bonus_db | 2020-11-14T15:06:06.656736Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
bonus_db | 2020-11-14T15:06:06.656771Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
bonus_db | 2020-11-14T15:06:06.657961Z 0 [Note] InnoDB: Waiting for purge to start
bonus_db | 2020-11-14T15:06:06.708340Z 0 [Note] InnoDB: 5.7.31 started; log sequence number 13750567
bonus_db | 2020-11-14T15:06:06.709023Z 0 [Note] Plugin 'FEDERATED' is disabled.
bonus_db | 2020-11-14T15:06:06.711205Z 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
bonus_db | 2020-11-14T15:06:06.715836Z 0 [Note] InnoDB: Buffer pool(s) load completed at 201114 15:06:06
bonus_db | 2020-11-14T15:06:06.721862Z 0 [Note] Found ca.pem, server-cert.pem and server-key.pem in data directory. Trying to enable SSL support using them.
bonus_db | 2020-11-14T15:06:06.721918Z 0 [Note] Skipping generation of SSL certificates as certificate files are present in data directory.
bonus_db | 2020-11-14T15:06:06.723943Z 0 [Warning] CA certificate ca.pem is self signed.
bonus_db | 2020-11-14T15:06:06.724051Z 0 [Note] Skipping generation of RSA key pair as key files are present in data directory.
bonus_db | 2020-11-14T15:06:06.725417Z 0 [Note] Server hostname (bind-address): '*'; port: 3306
bonus_db | 2020-11-14T15:06:06.725502Z 0 [Note] IPv6 is available.
bonus_db | 2020-11-14T15:06:06.725525Z 0 [Note] - '::' resolves to '::';
bonus_db | 2020-11-14T15:06:06.725562Z 0 [Note] Server socket created on IP: '::'.
bonus_db | 2020-11-14T15:06:06.740164Z 0 [Warning] Insecure configuration for --pid-file: Location '/var/run/mysqld' in the path is accessible to all OS users. Consider choosing a different directory.
bonus_db | 2020-11-14T15:06:06.765251Z 0 [Note] Event Scheduler: Loaded 0 events
bonus_db | 2020-11-14T15:06:06.765978Z 0 [Note] mysqld: ready for connections.
bonus_db | Version: '5.7.31' socket: '/var/run/mysqld/mysqld.sock' port: 3306 MySQL Community Server (GPL)
I tried to log in into container on remote machine like this:
docker exec -i bonus_db mysql -ubonus_user -pbonus_pass
And it seems working, because if I pass wrong password here, it will give the same error Access denied. I've also tried to import data from sql file
docker exec -i bonus_db mysql -ubonus_user -pbonus_pass bonus_db < dump.sql
and it also seems working, it's processing a couple of seconds and then exits to the terminal. But I cant access database from my local machine and from other containers too.

Access denied for user 'root'#'localhost' with mariadb 10.4.8 docker container using docker compose and issue while attaching external volume

I am new to Docker, I was trying to crate docker container of mariadb for my application but when I start running mariadb container it shows Access denied for user 'root'#'localhost' (using password: YES) dockerfile
Following is the docker compose I am using.
version: '3'
services:
mysql:
image: mariadb
container_name: mariadb
volumes:
- dbvolume:/var/lib/mysql
- ./AppDatabase.sql:/docker-entrypoint-initdb.d/AppDatabase.sql
environment:
MYSQL_ROOT_PASSWORD: root123
MYSQL_ROOT_USER: root
MYSQL_USER: root
MYSQL_PASSWORD: root123
MYSQL_DATABASE: appdata
ports:
- "3333:3306"
volumes:
dbvolume:
After trying for multiple times by referring few links I was able to connect my application to docker container but it failed to import AppDatabase.sql script at the time of creating docker container.
But now by using same docker compose file I am not able to connect mariadb to my application and I think even it's not importing SQL script to the database (based on logs I have observed).
Following is the docker log generated while running docker compose:
$ docker logs 3fde358ff015
2019-09-24 17:40:37 0 [Note] mysqld (mysqld 10.4.8-MariaDB-1:10.4.8+maria~bionic) starting as process 1 ...
2019-09-24 17:40:37 0 [Note] InnoDB: Using Linux native AIO
2019-09-24 17:40:37 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2019-09-24 17:40:37 0 [Note] InnoDB: Uses event mutexes
2019-09-24 17:40:37 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2019-09-24 17:40:37 0 [Note] InnoDB: Number of pools: 1
2019-09-24 17:40:37 0 [Note] InnoDB: Using SSE2 crc32 instructions
2019-09-24 17:40:37 0 [Note] mysqld: O_TMPFILE is not supported on /tmp (disabling future attempts)
2019-09-24 17:40:37 0 [Note] InnoDB: Initializing buffer pool, total size = 256M, instances = 1, chunk size = 128M
2019-09-24 17:40:37 0 [Note] InnoDB: Completed initialization of buffer pool
2019-09-24 17:40:37 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2019-09-24 17:40:37 0 [Note] InnoDB: Upgrading redo log: 2*50331648 bytes; LSN=21810033
2019-09-24 17:40:38 0 [Note] InnoDB: Starting to delete and rewrite log files.
2019-09-24 17:40:38 0 [Note] InnoDB: Setting log file ./ib_logfile101 size to 50331648 bytes
2019-09-24 17:40:38 0 [Note] InnoDB: Setting log file ./ib_logfile1 size to 50331648 bytes
2019-09-24 17:40:38 0 [Note] InnoDB: Renaming log file ./ib_logfile101 to ./ib_logfile0
2019-09-24 17:40:38 0 [Note] InnoDB: New log files created, LSN=21810033
2019-09-24 17:40:38 0 [Note] InnoDB: 128 out of 128 rollback segments are active.
2019-09-24 17:40:38 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2019-09-24 17:40:38 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2019-09-24 17:40:38 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2019-09-24 17:40:38 0 [Note] InnoDB: Waiting for purge to start
2019-09-24 17:40:38 0 [Note] InnoDB: 10.4.8 started; log sequence number 21810033; transaction id 14620
2019-09-24 17:40:38 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
2019-09-24 17:40:38 0 [Note] Plugin 'FEEDBACK' is disabled.
2019-09-24 17:40:38 0 [Note] Server socket created on IP: '::'.
2019-09-24 17:40:38 0 [Warning] 'proxies_priv' entry '#% root#c980daa43351' ignored in --skip-name-resolve mode.
2019-09-24 17:40:38 0 [Note] InnoDB: Buffer pool(s) load completed at 190924 17:40:38
2019-09-24 17:40:38 0 [Note] Reading of all Master_info entries succeeded
2019-09-24 17:40:38 0 [Note] Added new Master_info '' to hash table
2019-09-24 17:40:38 0 [Note] mysqld: ready for connections.
Version: '10.4.8-MariaDB-1:10.4.8+maria~bionic' socket: '/var/run/mysqld/mysqld.sock' port: 3306 mariadb.org binary distribution
SQL Script I am trying to import:
create database appdata;
use appdata;
CREATE TABLE `appdatadetails` (
`Name` varchar(8) NOT NULL,
`appIndex` int(11) NOT NULL,
`connector` varchar(16) DEFAULT NULL,
`intName` varchar(12) DEFAULT NULL,
`intIndex` int(11) DEFAULT NULL,
PRIMARY KEY (`Name`,`appIndex`)
)
Please help me to understand what I am doing wrong, I have tried all possible solution posted on different blogs.
Update:
Latest Update:
I was able to up and running mariadb docker image with 10.1. But if I attach volume then still I am facing issue.
Docker Compose:
version: '3'
services:
mysql:
image: mariadb:10.1
container_name: mariadb
volumes:
- container-volume:/var/lib/mysql
- ./AppDatabase.sql:/docker-entrypoint-initdb.d/AppDatabase.sql
environment:
MYSQL_ROOT_PASSWORD: root123
MYSQL_DATABASE: appdata
ports:
- "3333:3306"
volumes:
container-volume:
And the log error message, If I attach container-volume volume.
Creating mariadb ... done
Attaching to mariadb
mariadb | 2019-09-25 6:56:26 140542855440384 [Note] mysqld (mysqld 10.1.41-MariaDB-1~bionic) starting as process 1 ...
mariadb | 2019-09-25 6:56:26 140542855440384 [Note] InnoDB: Using mutexes to ref count buffer pool pages
mariadb | 2019-09-25 6:56:26 140542855440384 [Note] InnoDB: The InnoDB memory heap is disabled
mariadb | 2019-09-25 6:56:26 140542855440384 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
mariadb | 2019-09-25 6:56:26 140542855440384 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
mariadb | 2019-09-25 6:56:26 140542855440384 [Note] InnoDB: Compressed tables use zlib 1.2.11
mariadb | 2019-09-25 6:56:26 140542855440384 [Note] InnoDB: Using Linux native AIO
mariadb | 2019-09-25 6:56:26 140542855440384 [Note] InnoDB: Using SSE crc32 instructions
mariadb | 2019-09-25 6:56:26 140542855440384 [Note] InnoDB: Initializing buffer pool, size = 256.0M
mariadb | 2019-09-25 6:56:26 140542855440384 [Note] InnoDB: Completed initialization of buffer pool
mariadb | 2019-09-25 6:56:26 140542855440384 [Note] InnoDB: Highest supported file format is Barracuda.
mariadb | InnoDB: No valid checkpoint found.
mariadb | InnoDB: A downgrade from MariaDB 10.2.2 or later is not supported.
mariadb | InnoDB: If this error appears when you are creating an InnoDB database,
mariadb | InnoDB: the problem may be that during an earlier attempt you managed
mariadb | InnoDB: to create the InnoDB data files, but log file creation failed.
mariadb | InnoDB: If that is the case, please refer to
mariadb | InnoDB: http://dev.mysql.com/doc/refman/5.6/en/error-creating-innodb.html
mariadb | 2019-09-25 6:56:26 140542855440384 [ERROR] Plugin 'InnoDB' init function returned error.
mariadb | 2019-09-25 6:56:26 140542855440384 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
mariadb | 2019-09-25 6:56:26 140542855440384 [Note] Plugin 'FEEDBACK' is disabled.
mariadb | 2019-09-25 6:56:26 140542855440384 [ERROR] Unknown/unsupported storage engine: InnoDB
mariadb | 2019-09-25 6:56:26 140542855440384 [ERROR] Aborting
mariadb |
mariadb exited with code 1
If I remove container-volume then It is importing .sql script and running well and good.
Updated with working script: Before I was using mariadb 10.4.8 or latest and facing issue(s) to access DB and attaching external volume.
Now I have downgraded (As suggested by #Adiii) and tried. It runs perfectlly and we no need to specify external: true in volumes service
version: '3'
services:
mysql:
image: mariadb:10.1
container_name: mariadb
volumes:
- ./dbvolume:/var/lib/mysql
- ./AppDatabase.sql:/docker-entrypoint-initdb.d/AppDatabase.sql
environment:
MYSQL_ROOT_PASSWORD: root123
MYSQL_DATABASE: appdata
ports:
- "3333:3306"
It will affect the new user and keys even if you create fresh container.
Remove mount location, as it will pick a user name and password from this location, also will not run your DB init script too.
volumes:
- dbvolume:/var/lib/mysql
Also you do not need
create database appdata;
As database already created at
MYSQL_ROOT_PASSWORD: root123
MYSQL_ROOT_USER: root
MYSQL_DATABASE: appdata
this step.
update:
remove the user root, as root already defined. you can try with
version: '3.7'
services:
mysql:
environment:
MYSQL_ROOT_PASSWORD: root123
MYSQL_DATABASE: appdata
image: mariadb
Or the second user should be different
version: '3.7'
services:
mysql:
environment:
MYSQL_ROOT_PASSWORD: root123
MYSQL_DATABASE: appdata
MYSQL_USER: test
MYSQL_PASSWORD: root123
image: mariadb
you can try with
docker exec -it container_name bash -c "mysql -u test -proot123"
or
docker exec -it mysql bash -c "mysql -u root -proot123"
If still issue, remove the DB image, pull a new one.
Or try image tag 10.1
If I remove container-volume then It is importing .sql script and
running well and good.
if mount the location then the init script will not run as the container is expecting that there is already DB or try to remove named volume and create new one.
So mount the location, import the DB using MySQL command and use the mount location for next time.

can't reach wordpress site on docker

I am trying to create a docker machine that will run 3 containers:
Wordpress, mysql and phpMyAdmin. This is my docker compose file:
version: '3.1'
services:
wordpress:
volumes:
- E:\Demo Sites\testSite\public_html:/var/www/html
depends_on:
- db
image: wordpress:latest
restart: unless-stopped
ports:
- 8080:80
environment:
WORDPRESS_DB_HOST: db
WORDPRESS_DB_USER: user2
WORDPRESS_DB_PASSWORD: pass2
WORDPRESS_DB_NAME: db2
db:
image: mysql:5.7
restart: always
ports:
- 3306:3306
environment:
MYSQL_DATABASE: db2
MYSQL_USER: user2
MYSQL_PASSWORD: pass2
MYSQL_ROOT_PASSWORD: test_pass2
volumes:
- db_data:/var/lib/mysql
phpmyadmin:
image: phpmyadmin/phpmyadmin:latest
links:
- db:db
restart: always
depends_on:
- db
ports:
- 9191:80
environment:
MYSQL_USERNAME: root
MYSQL_ROOT_PASSWORD: test_pass2
MYSQL_PASSWORD: test_pass2
volumes:
db_data:
I ran docker system prune in order to start fresh. Then, I ran the file using docker-compose up. phpMyAdmin works as expected, but I can't reach the wordpress site at 192.168.99.100:8080. These are the logs:
Creating demosites_db_1 ... done
Creating demosites_phpmyadmin_1 ... done
Creating demosites_wordpress_1 ... done
Attaching to demosites_db_1, demosites_phpmyadmin_1, demosites_wordpress_1
db_1 | 2018-12-25T14:30:06.003349Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
db_1 | 2018-12-25T14:30:06.014038Z 0 [Note] mysqld (mysqld 5.7.24) starting as process 1 ...
db_1 | 2018-12-25T14:30:06.030769Z 0 [Note] InnoDB: PUNCH HOLE support available
db_1 | 2018-12-25T14:30:06.030841Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
db_1 | 2018-12-25T14:30:06.030868Z 0 [Note] InnoDB: Uses event mutexes
db_1 | 2018-12-25T14:30:06.030890Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
db_1 | 2018-12-25T14:30:06.030911Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
db_1 | 2018-12-25T14:30:06.030932Z 0 [Note] InnoDB: Using Linux native AIO
db_1 | 2018-12-25T14:30:06.043746Z 0 [Note] InnoDB: Number of pools: 1
db_1 | 2018-12-25T14:30:06.075840Z 0 [Note] InnoDB: Using CPU crc32 instructions
db_1 | 2018-12-25T14:30:06.084608Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
db_1 | 2018-12-25T14:30:06.147100Z 0 [Note] InnoDB: Completed initialization of buffer pool
db_1 | 2018-12-25T14:30:06.196456Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
db_1 | 2018-12-25T14:30:06.245622Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
db_1 | 2018-12-25T14:30:06.503315Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
db_1 | 2018-12-25T14:30:06.504395Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
db_1 | 2018-12-25T14:30:06.739272Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
db_1 | 2018-12-25T14:30:06.742497Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
db_1 | 2018-12-25T14:30:06.743304Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
db_1 | 2018-12-25T14:30:06.744156Z 0 [Note] InnoDB: Waiting for purge to start
db_1 | 2018-12-25T14:30:06.796032Z 0 [Note] InnoDB: 5.7.24 started; log sequence number 12372193
db_1 | 2018-12-25T14:30:06.796536Z 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
db_1 | 2018-12-25T14:30:06.797064Z 0 [Note] Plugin 'FEDERATED' is disabled.
db_1 | 2018-12-25T14:30:06.886235Z 0 [Note] InnoDB: Buffer pool(s) load completed at 181225 14:30:06
db_1 | 2018-12-25T14:30:06.912383Z 0 [Note] Found ca.pem, server-cert.pem and server-key.pem in data directory. Trying to enable SSL support using them.
db_1 | 2018-12-25T14:30:06.916997Z 0 [Warning] CA certificate ca.pem is self signed.
db_1 | 2018-12-25T14:30:06.934450Z 0 [Note] Server hostname (bind-address): '*'; port: 3306
db_1 | 2018-12-25T14:30:06.936498Z 0 [Note] IPv6 is available.
db_1 | 2018-12-25T14:30:06.937204Z 0 [Note] - '::' resolves to '::';
db_1 | 2018-12-25T14:30:06.937558Z 0 [Note] Server socket created on IP: '::'.
db_1 | 2018-12-25T14:30:06.959182Z 0 [Warning] Insecure configuration for --pid-file: Location '/var/run/mysqld' in the path is accessible to all OS users. Consider choosing a different directory.
db_1 | 2018-12-25T14:30:06.967176Z 0 [Warning] 'user' entry 'root#localhost' ignored in --skip-name-resolve mode.
db_1 | 2018-12-25T14:30:06.967504Z 0 [Warning] 'user' entry 'mysql.session#localhost' ignored in --skip-name-resolve mode.
db_1 | 2018-12-25T14:30:06.967822Z 0 [Warning] 'user' entry 'mysql.sys#localhost' ignored in --skip-name-resolve mode.
db_1 | 2018-12-25T14:30:06.968512Z 0 [Warning] 'db' entry 'performance_schema mysql.session#localhost' ignored in --skip-name-resolve mode.
db_1 | 2018-12-25T14:30:06.968914Z 0 [Warning] 'db' entry 'sys mysql.sys#localhost' ignored in --skip-name-resolve mode.
db_1 | 2018-12-25T14:30:06.969441Z 0 [Warning] 'proxies_priv' entry '# root#localhost' ignored in --skip-name-resolve mode.
db_1 | 2018-12-25T14:30:06.997582Z 0 [Warning] 'tables_priv' entry 'user mysql.session#localhost' ignored in --skip-name-resolve mode.
db_1 | 2018-12-25T14:30:06.997923Z 0 [Warning] 'tables_priv' entry 'sys_config mysql.sys#localhost' ignored in --skip-name-resolve mode.
db_1 | 2018-12-25T14:30:07.085365Z 0 [Note] Event Scheduler: Loaded 0 events
phpmyadmin_1 | phpMyAdmin not found in /var/www/html - copying now...
wordpress_1 | AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.20.0.4. Set the 'ServerName' directive globally to suppress this message
wordpress_1 | AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.20.0.4. Set the 'ServerName' directive globally to suppress this message
wordpress_1 | [Tue Dec 25 14:30:09.921193 2018] [mpm_prefork:notice] [pid 1] AH00163: Apache/2.4.25 (Debian) PHP/7.2.13 configured -- resuming normal operations
phpmyadmin_1 | Complete! phpMyAdmin has been successfully copied to /var/www/html
phpmyadmin_1 | /usr/lib/python2.7/site-packages/supervisor/options.py:461: UserWarning: Supervisord is running as root and it is searching for its configuration file in default locations (including its current working directory); you probably want to specify a "-c" argument specifying an absolute path to a configuration file for improved security.
phpmyadmin_1 | 'Supervisord is running as root and it is searching '
phpmyadmin_1 | 2018-12-25 14:30:10,239 CRIT Supervisor is running as root. Privileges were not dropped because no user is specified in the config file. If you intend to run as root, you can set user=root in the config file to avoid this message.
phpmyadmin_1 | 2018-12-25 14:30:10,240 INFO Included extra file "/etc/supervisor.d/nginx.ini" during parsing
phpmyadmin_1 | 2018-12-25 14:30:10,241 INFO Included extra file "/etc/supervisor.d/php.ini" during parsing
phpmyadmin_1 | 2018-12-25 14:30:10,276 INFO RPC interface 'supervisor' initialized
phpmyadmin_1 | 2018-12-25 14:30:10,277 CRIT Server 'unix_http_server' running without any HTTP authentication checking
phpmyadmin_1 | 2018-12-25 14:30:10,278 INFO supervisord started with pid 1
phpmyadmin_1 | 2018-12-25 14:30:11,283 INFO spawned: 'php-fpm' with pid 21
phpmyadmin_1 | 2018-12-25 14:30:11,291 INFO spawned: 'nginx' with pid 22
phpmyadmin_1 | [25-Dec-2018 14:30:11] NOTICE: fpm is running, pid 21
phpmyadmin_1 | [25-Dec-2018 14:30:11] NOTICE: ready to handle connections
phpmyadmin_1 | 2018-12-25 14:30:12,466 INFO success: php-fpm entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
In addition, I can see that no folder is created under E:/Demo Sites. It used to work perfectly and therefor I am pretty lost on this one. Thanks in advance.
EDIT: I found it that if I write any path inside the site (i.e. 192.168.99.100:8080/aaa) it works and takes me to the wordpress installation page. I have absolutely no idea why, but it does work.
I think you need to specify that WordPress depends on PHP too

Error connecting to MariaDB using Docker-Compose, "Connection Lost: The server closed the connection"

I'm trying to connect the official MariaDB docker image to an image of my client-side application with the command docker-compose up; it successfully connects to the server but when trying to connect to the MariaDB database, after about a minute logs "Error: Connection lost: The server closed the connection." I have no problem connecting to the database locally when starting the server, but it throws the error when trying to link docker images of the same code.
My docker-compose.yml:
version: '3.1'
services:
webapp:
image: client
ports:
- "3306:3306"
links:
- db
depends_on:
- db
environment:
DATABASE_URL: "mysql://root:root#db/yelp"
db:
image: mariadb:latest
restart: always
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: yelp
adminer:
image: adminer
restart: always
ports:
- 3001:3001
Dockerfile:
FROM node:10
WORKDIR /cadenza/documents/SDC/leaveReview
COPY package*.json ./
RUN npm install
COPY . .
EXPOSE 3306
CMD ["npm", "start"]
mysql/MariaDB index.js connection file:
var mysql = require('mysql')
var connection = mysql.createConnection({
host: '127.0.0.1',
user: 'root',
password: 'root',
database: 'yelp'
});
connection.connect((err) => {
if (err) {
console.log('error when connecting to db', err);
} else {
console.log('connected to db')
}
});
module.exports = connection;
Logs when running docker-compose up:
docker-compose up
Starting leavereview_db_1 ... done
Starting leavereview_adminer_1 ... done
Starting leavereview_webapp_1 ... done
Attaching to leavereview_adminer_1, leavereview_db_1, leavereview_webapp_1
adminer_1 | PHP 7.2.7 Development Server started at Tue Jul 3 02:34:03 2018
webapp_1 |
webapp_1 | > yelp-reviews#1.0.0 start /cadenza/documents/SDC/leaveReview
webapp_1 | > nodemon server/index.js
webapp_1 |
db_1 | 2018-07-03 2:34:04 0 [Note] mysqld (mysqld 10.3.7-MariaDB-1:10.3.7+maria~jessie) starting as process 1 ...
db_1 | 2018-07-03 2:34:04 0 [Note] InnoDB: Using Linux native AIO
db_1 | 2018-07-03 2:34:04 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
db_1 | 2018-07-03 2:34:04 0 [Note] InnoDB: Uses event mutexes
db_1 | 2018-07-03 2:34:04 0 [Note] InnoDB: Compressed tables use zlib 1.2.8
db_1 | 2018-07-03 2:34:04 0 [Note] InnoDB: Number of pools: 1
db_1 | 2018-07-03 2:34:04 0 [Note] InnoDB: Using SSE2 crc32 instructions
db_1 | 2018-07-03 2:34:04 0 [Note] InnoDB: Initializing buffer pool, total size = 256M, instances = 1, chunk size = 128M
db_1 | 2018-07-03 2:34:04 0 [Note] InnoDB: Completed initialization of buffer pool
db_1 | 2018-07-03 2:34:04 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
db_1 | 2018-07-03 2:34:04 0 [Note] InnoDB: Starting crash recovery from checkpoint LSN=1630896
db_1 | 2018-07-03 2:34:04 0 [Note] InnoDB: 128 out of 128 rollback segments are active.
db_1 | 2018-07-03 2:34:04 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
db_1 | 2018-07-03 2:34:04 0 [Note] InnoDB: Creating shared tablespace for temporary tables
db_1 | 2018-07-03 2:34:04 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
db_1 | 2018-07-03 2:34:04 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
db_1 | 2018-07-03 2:34:04 0 [Note] InnoDB: Waiting for purge to start
webapp_1 | [nodemon] 1.17.5
webapp_1 | [nodemon] to restart at any time, enter `rs`
webapp_1 | [nodemon] watching: *.*
webapp_1 | [nodemon] starting `node server/index.js`
db_1 | 2018-07-03 2:34:04 0 [Note] InnoDB: 10.3.7 started; log sequence number 1630905; transaction id 21
db_1 | 2018-07-03 2:34:04 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
db_1 | 2018-07-03 2:34:04 0 [Note] Plugin 'FEEDBACK' is disabled.
db_1 | 2018-07-03 2:34:04 0 [Note] Recovering after a crash using tc.log
db_1 | 2018-07-03 2:34:04 0 [Note] Starting crash recovery...
db_1 | 2018-07-03 2:34:04 0 [Note] Crash recovery finished.
db_1 | 2018-07-03 2:34:04 0 [Note] Server socket created on IP: '::'.
db_1 | 2018-07-03 2:34:04 0 [Note] InnoDB: Buffer pool(s) load completed at 180703 2:34:04
db_1 | 2018-07-03 2:34:04 0 [Warning] 'proxies_priv' entry '#% root#a1a244ac54cf' ignored in --skip-name-resolve mode.
db_1 | 2018-07-03 2:34:04 0 [Note] Reading of all Master_info entries succeded
db_1 | 2018-07-03 2:34:04 0 [Note] Added new Master_info '' to hash table
db_1 | 2018-07-03 2:34:04 0 [Note] mysqld: ready for connections.
db_1 | Version: '10.3.7-MariaDB-1:10.3.7+maria~jessie' socket: '/var/run/mysqld/mysqld.sock' port: 3306 mariadb.org binary distribution
webapp_1 | Listening on port 3306
webapp_1 | error when connecting to db { Error: Connection lost: The server closed the connection.
webapp_1 | at Protocol.end (/cadenza/documents/SDC/leaveReview/node_modules/mysql/lib/protocol/Protocol.js:113:13)
webapp_1 | at Socket.<anonymous> (/cadenza/documents/SDC/leaveReview/node_modules/mysql/lib/Connection.js:109:28)
webapp_1 | at Socket.emit (events.js:187:15)
webapp_1 | at endReadableNT (_stream_readable.js:1081:12)
webapp_1 | at process._tickCallback (internal/process/next_tick.js:63:19)
webapp_1 | --------------------
webapp_1 | at Protocol._enqueue (/cadenza/documents/SDC/leaveReview/node_modules/mysql/lib/protocol/Protocol.js:145:48)
webapp_1 | at Protocol.handshake (/cadenza/documents/SDC/leaveReview/node_modules/mysql/lib/protocol/Protocol.js:52:23)
webapp_1 | at Connection.connect (/cadenza/documents/SDC/leaveReview/node_modules/mysql/lib/Connection.js:130:18)
webapp_1 | at Object.<anonymous> (/cadenza/documents/SDC/leaveReview/database/index.js:9:12)
webapp_1 | at Module._compile (internal/modules/cjs/loader.js:702:30)
webapp_1 | at Object.Module._extensions..js (internal/modules/cjs/loader.js:713:10)
webapp_1 | at Module.load (internal/modules/cjs/loader.js:612:32)
webapp_1 | at tryModuleLoad (internal/modules/cjs/loader.js:551:12)
webapp_1 | at Function.Module._load (internal/modules/cjs/loader.js:543:3)
webapp_1 | at Module.require (internal/modules/cjs/loader.js:650:17) fatal: true, code: 'PROTOCOL_CONNECTION_LOST' }
webapp_1 | (node:29) [DEP0096] DeprecationWarning: timers.unenroll() is deprecated. Please use clearTimeout instead.
It should be logging "connected to db". I have also tried solutions that people have suggest for handling server disconnect due to being idle etc etc, but it doesn't even connect to the database in the first place.
So it connected after I changed the host in the database connection index.js file from '127.0.0.1' to:
var connection = mysql.createConnection({
host: 'db',
user: 'root',
password: 'root',
database: 'yelp'
});
where 'db' is referring to the 'db' image in my docker-compose.yml file.
When a developer approaches me saying that his application cannot connect to a container, this is what I usually do. I give them the following setup.
docker-compose.yml:
version: '3.1'
services:
webapp:
build: .
db:
image: mariadb:latest
restart: always
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: yelp
Dockerfile:
FROM alpine
RUN apk add -U mysql-client
COPY entry.sh .
CMD ["/bin/sh", "entry.sh"]
entry.sh:
#!/bin/sh
echo "Waiting for mysql..."
until mysqladmin ping -h"db" -P"3306" --silent
do
echo "mysql is not ready will retry in 5..."
sleep 5
done
echo -e "\nmysql is ready"
mysql -h"db" -P"3306" -p"root" -u"root" -e "SHOW DATABASES"
And this works, when you run docker-compose up, output being something along these lines:
Starting 51145943_db_1 ... done
Starting 51145943_webapp_1 ... done
Attaching to 51145943_webapp_1, 51145943_db_1
webapp_1 | Waiting for mysql...
webapp_1 | mysql is not ready will retry in 5...
db_1 | 2018-07-03 3:17:10 0 [Note] mysqld (mysqld 10.3.7-MariaDB-1:10.3.7+maria~jessie) starting as process 1 ...
db_1 | 2018-07-03 3:17:10 0 [Note] InnoDB: Using Linux native AIO
db_1 | 2018-07-03 3:17:10 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
db_1 | 2018-07-03 3:17:10 0 [Note] InnoDB: Uses event mutexes
db_1 | 2018-07-03 3:17:10 0 [Note] InnoDB: Compressed tables use zlib 1.2.8
db_1 | 2018-07-03 3:17:10 0 [Note] InnoDB: Number of pools: 1
db_1 | 2018-07-03 3:17:10 0 [Note] InnoDB: Using SSE2 crc32 instructions
db_1 | 2018-07-03 3:17:10 0 [Note] InnoDB: Initializing buffer pool, total size = 256M, instances = 1, chunk size = 128M
db_1 | 2018-07-03 3:17:10 0 [Note] InnoDB: Completed initialization of buffer pool
db_1 | 2018-07-03 3:17:10 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
db_1 | 2018-07-03 3:17:11 0 [Note] InnoDB: 128 out of 128 rollback segments are active.
db_1 | 2018-07-03 3:17:11 0 [Note] InnoDB: Creating shared tablespace for temporary tables
db_1 | 2018-07-03 3:17:11 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
db_1 | 2018-07-03 3:17:11 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
db_1 | 2018-07-03 3:17:11 0 [Note] InnoDB: 10.3.7 started; log sequence number 1630896; transaction id 21
db_1 | 2018-07-03 3:17:11 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
db_1 | 2018-07-03 3:17:11 0 [Note] Plugin 'FEEDBACK' is disabled.
db_1 | 2018-07-03 3:17:11 0 [Note] Server socket created on IP: '::'.
db_1 | 2018-07-03 3:17:11 0 [Warning] 'proxies_priv' entry '#% root#4a91686036a2' ignored in --skip-name-resolve mode.
db_1 | 2018-07-03 3:17:11 0 [Note] InnoDB: Buffer pool(s) load completed at 180703 3:17:11
db_1 | 2018-07-03 3:17:11 0 [Note] Reading of all Master_info entries succeded
db_1 | 2018-07-03 3:17:11 0 [Note] Added new Master_info '' to hash table
db_1 | 2018-07-03 3:17:11 0 [Note] mysqld: ready for connections.
db_1 | Version: '10.3.7-MariaDB-1:10.3.7+maria~jessie' socket: '/var/run/mysqld/mysqld.sock' port: 3306 mariadb.org binary distribution
db_1 | 2018-07-03 3:17:15 8 [Warning] Access denied for user 'root'#'172.22.0.3' (using password: NO)
webapp_1 |
webapp_1 | mysql is ready
webapp_1 | Database
webapp_1 | information_schema
webapp_1 | mysql
webapp_1 | performance_schema
webapp_1 | yelp
51145943_webapp_1 exited with code 0
This proves that connectivity between containers is working and whatever problem they have is application specific. May be the pass the connection string in a wrong format, or using wrong server name, or trying to connect to early when mysql is not up yet.
Having proven this, they now can "bridge the gap" making small changes to their own or my setup, trying to bring them closer until something breaks. That last step reveals the culprit. For example, if the add mysql command line connection to their application container and it indeed connects, but their application does not, it means that they need to look for the reason in their application code.
From my experience this the quickest way to sort out problems like this, when the reason is not immediately obvious.

MySQL container failing to run initialisation scripts in Docker Compose

I am having issues getting my MySQL container to run some initialisation scripts (creating some databases) from Docker Compose. As per the documentation on Docker Hub, I mount the .sql files in /docker-entrypoint-initdb.d but to no avail.
My compose files is as follows:
version: '2'
services:
database:
image: mysql
ports:
- "3307:3306"
environment:
MYSQL_ROOT_PASSWORD: root
volumes:
- ./scripts/db:/docker-entrypoint-initdb.d
myservice:
image: company/myservice
expose:
- "10001"
depends_on:
- database
links:
- database
environment:
SERVICE_PORT: 10001
DATABASE_URL: jdbc:mysql://database:3306/myservice?autoReconnect=true&useSSL=false&characterEncoding=UTF-8
And the contents of ./scripts/db is just 1 file init-databases.sql:
CREATE DATABASE myservice;
Once started up, MySQL is running, but the database is not created. The service container also successfully links to the MySQL container. Bashing into the MySQL container; the init scripts are successfully mounted in the correct location.
Can anyone see some obvious issues here?
LOGS FROM compose
database_1 | 2016-04-01T05:35:55.020279Z 0 [Note] mysqld (mysqld 5.7.11) starting as process 1 ...
database_1 | 2016-04-01T05:35:55.023277Z 0 [Note] InnoDB: PUNCH HOLE support available
database_1 | 2016-04-01T05:35:55.023305Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
database_1 | 2016-04-01T05:35:55.023316Z 0 [Note] InnoDB: Uses event mutexes
database_1 | 2016-04-01T05:35:55.023324Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
database_1 | 2016-04-01T05:35:55.023332Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.8
database_1 | 2016-04-01T05:35:55.023344Z 0 [Note] InnoDB: Using Linux native AIO
database_1 | 2016-04-01T05:35:55.023491Z 0 [Note] InnoDB: Number of pools: 1
database_1 | 2016-04-01T05:35:55.023566Z 0 [Note] InnoDB: Using CPU crc32 instructions
database_1 | 2016-04-01T05:35:55.028689Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
database_1 | 2016-04-01T05:35:55.041026Z 0 [Note] InnoDB: Completed initialization of buffer pool
database_1 | 2016-04-01T05:35:55.047324Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
database_1 | 2016-04-01T05:35:55.061537Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
database_1 | 2016-04-01T05:35:55.076895Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
database_1 | 2016-04-01T05:35:55.076987Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
database_1 | 2016-04-01T05:35:55.095683Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
database_1 | 2016-04-01T05:35:55.096484Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
database_1 | 2016-04-01T05:35:55.096540Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
database_1 | 2016-04-01T05:35:55.096931Z 0 [Note] InnoDB: Waiting for purge to start
database_1 | 2016-04-01T05:35:55.147986Z 0 [Note] InnoDB: 5.7.11 started; log sequence number 11992841
database_1 | 2016-04-01T05:35:55.148204Z 0 [Note] Plugin 'FEDERATED' is disabled.
database_1 | 2016-04-01T05:35:55.149262Z 0 [Note] Found ca.pem, server-cert.pem and server-key.pem in data directory. Trying to enable SSL support using them.
database_1 | 2016-04-01T05:35:55.149443Z 0 [Warning] CA certificate ca.pem is self signed.
database_1 | 2016-04-01T05:35:55.150272Z 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
database_1 | 2016-04-01T05:35:55.151068Z 0 [Note] InnoDB: Buffer pool(s) load completed at 160401 5:35:55
database_1 | 2016-04-01T05:35:55.152775Z 0 [Note] Server hostname (bind-address): '*'; port: 3306
database_1 | 2016-04-01T05:35:55.154441Z 0 [Note] IPv6 is available.
database_1 | 2016-04-01T05:35:55.154553Z 0 [Note] - '::' resolves to '::';
database_1 | 2016-04-01T05:35:55.154571Z 0 [Note] Server socket created on IP: '::'.
database_1 | 2016-04-01T05:35:55.156680Z 0 [Warning] 'db' entry 'sys mysql.sys#localhost' ignored in --skip-name-resolve mode.
database_1 | 2016-04-01T05:35:55.156738Z 0 [Warning] 'proxies_priv' entry '# root#localhost' ignored in --skip-name-resolve mode.
database_1 | 2016-04-01T05:35:55.158280Z 0 [Warning] 'tables_priv' entry 'sys_config mysql.sys#localhost' ignored in --skip-name-resolve mode.
database_1 | 2016-04-01T05:35:55.165273Z 0 [Note] Event Scheduler: Loaded 0 events
database_1 | 2016-04-01T05:35:55.173462Z 0 [Note] mysqld: ready for connections.
database_1 | Version: '5.7.11' socket: '/var/run/mysqld/mysqld.sock' port: 3306 MySQL Community Server (GPL)
Check if this is a docker-compose issue (like issue 115 which redirected to issue 2266)
I don't think the error is related to build, it's mostly likely volumes.
Compose preserves volumes so that you don't lose data (this will be better documented in the next release).
To remove those volumes run docker-compose rm -vf. The next time you docker-compose up it should start with fresh empty volumes.
According to hub.docker.com/mysql, check also if this is not a synchronization issue:
If there is no database initialized when the container starts, then a default database will be created. While this is the expected behavior, this means that it will not accept incoming connections until such initialization completes. This may cause issues when using automation tools, such as docker-compose, which start several containers simultaneously.