I'm having problems with docker-compose for a while now and can't figure out what's going on there. Given is the following scenario - which worked before but stopped working on a new project and now on every new stack I build up:
$ docker --version
Docker version 20.10.12, build e91ed57
$ docker-compose --version
Docker Compose version v2.2.2
OS: Pop!_OS 21.10 (NVIDIA)
Filestructure:
/myfolder
+ app-src (containing my laravel-project)
+ database-dumps (for database-dumps - containing a .gitkeep-file)
+ database_persist (for persistent data - containing a .gitkeep-file)
- .env
- .gitignore
- buildcontrainer.sh (custom script)
- container-start.sh (custom script)
- docker-compose.yml
- migrate-database.sh (custom script)
- README.md
This is the shortened docker-compose.yml-file (shortened, because it only affects the database... nginx and the php-container are working fine):
version: '3'
services:
database:
environment:
- MYSQL_DATABASE=${DB_DATABASE}
- MYSQL_USER=${DB_USER}
- MYSQL_PASSWORD=${DB_PASSWORD}
- MYSQL_ROOT_PASSWORD=${DB_ROOT_PASSWORD}
image: mariadb:10.6.1
ports:
- "${DB_EXPOSE_PORT}:3306"
volumes:
- "./database_persist:/var/lib/mysqldata"
And the .env-File:
COMPOSE_PROJECT_NAME=MyProject
DB_DATABASE="myprojectdb"
DB_USER="myproject"
DB_PASSWORD="12345"
DB_ROOT_PASSWORD="12345"
DB_EXPOSE_PORT=9036
WEB_EXPOSE_PORT_HTTP=9080
WEB_EXPOSE_PORT_HTTPS=9043
Now to my problem - whenever I try to set up an environment like given in the scenario and I run docker-compose build and docker-compose up afterwards I get the following output:
Creating network "myproject_default" with the default driver
Creating myproject_database_1 ... done
Attaching to myproject_database_1
database_1 | 2021-12-25 15:30:53+00:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:10.6.1+maria~focal started.
database_1 | 2021-12-25 15:30:53+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
database_1 | 2021-12-25 15:30:53+00:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:10.6.1+maria~focal started.
database_1 | 2021-12-25 15:30:53+00:00 [Note] [Entrypoint]: Initializing database files
database_1 | 2021-12-25 15:30:53 0 [Warning] You need to use --log-bin to make --expire-logs-days or --binlog-expire-logs-seconds work.
database_1 |
database_1 |
database_1 | PLEASE REMEMBER TO SET A PASSWORD FOR THE MariaDB root USER !
database_1 | To do so, start the server, then issue the following commands:
database_1 |
database_1 | '/usr/bin/mysqladmin' -u root password 'new-password'
database_1 | '/usr/bin/mysqladmin' -u root -h password 'new-password'
database_1 |
database_1 | Alternatively you can run:
database_1 | '/usr/bin/mysql_secure_installation'
database_1 |
database_1 | which will also give you the option of removing the test
database_1 | databases and anonymous user created by default. This is
database_1 | strongly recommended for production servers.
database_1 |
database_1 | See the MariaDB Knowledgebase at https://mariadb.com/kb or the
database_1 | MySQL manual for more instructions.
database_1 |
database_1 | Please report any problems at https://mariadb.org/jira
database_1 |
database_1 | The latest information about MariaDB is available at https://mariadb.org/.
database_1 | You can find additional information about the MySQL part at:
database_1 | https://dev.mysql.com
database_1 | Consider joining MariaDB's strong and vibrant community:
database_1 | https://mariadb.org/get-involved/
database_1 |
database_1 | 2021-12-25 15:30:57+00:00 [Note] [Entrypoint]: Database files initialized
database_1 | 2021-12-25 15:30:57+00:00 [Note] [Entrypoint]: Starting temporary server
database_1 | 2021-12-25 15:30:57+00:00 [Note] [Entrypoint]: Waiting for server startup
database_1 | 2021-12-25 15:30:57 0 [Note] mysqld (mysqld 10.6.1-MariaDB-1:10.6.1+maria~focal) starting as process 110 ...
database_1 | 2021-12-25 15:30:57 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
database_1 | 2021-12-25 15:30:57 0 [Note] InnoDB: Number of pools: 1
database_1 | 2021-12-25 15:30:57 0 [Note] InnoDB: Using crc32 + pclmulqdq instructions
database_1 | 2021-12-25 15:30:57 0 [Note] mysqld: O_TMPFILE is not supported on /tmp (disabling future attempts)
database_1 | 2021-12-25 15:30:57 0 [Note] InnoDB: Using Linux native AIO
database_1 | 2021-12-25 15:30:57 0 [Note] InnoDB: Initializing buffer pool, total size = 134217728, chunk size = 134217728
database_1 | 2021-12-25 15:30:57 0 [Note] InnoDB: Completed initialization of buffer pool
database_1 | 2021-12-25 15:30:57 0 [Note] InnoDB: 128 rollback segments are active.
database_1 | 2021-12-25 15:30:57 0 [Note] InnoDB: Creating shared tablespace for temporary tables
database_1 | 2021-12-25 15:30:57 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
database_1 | 2021-12-25 15:30:57 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
database_1 | 2021-12-25 15:30:57 0 [Note] InnoDB: 10.6.1 started; log sequence number 42616; transaction id 18
database_1 | 2021-12-25 15:30:57 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
database_1 | 2021-12-25 15:30:57 0 [Note] Plugin 'FEEDBACK' is disabled.
database_1 | 2021-12-25 15:30:57 0 [Warning] You need to use --log-bin to make --expire-logs-days or --binlog-expire-logs-seconds work.
database_1 | 2021-12-25 15:30:57 0 [Warning] 'user' entry 'root#66d18f02ea8a' ignored in --skip-name-resolve mode.
database_1 | 2021-12-25 15:30:57 0 [Warning] 'proxies_priv' entry '#% root#66d18f02ea8a' ignored in --skip-name-resolve mode.
database_1 | 2021-12-25 15:30:57 0 [Note] InnoDB: Buffer pool(s) load completed at 211225 15:30:57
database_1 | 2021-12-25 15:30:57 0 [Note] mysqld: ready for connections.
database_1 | Version: '10.6.1-MariaDB-1:10.6.1+maria~focal' socket: '/run/mysqld/mysqld.sock' port: 0 mariadb.org binary distribution
database_1 | 2021-12-25 15:30:58+00:00 [Note] [Entrypoint]: Temporary server started.
database_1 | Warning: Unable to load '/usr/share/zoneinfo/leap-seconds.list' as time zone. Skipping it.
database_1 | Warning: Unable to load '/usr/share/zoneinfo/leapseconds' as time zone. Skipping it.
database_1 | Warning: Unable to load '/usr/share/zoneinfo/tzdata.zi' as time zone. Skipping it.
database_1 | 2021-12-25 15:31:01 5 [Warning] 'proxies_priv' entry '#% root#66d18f02ea8a' ignored in --skip-name-resolve mode.
database_1 | 2021-12-25 15:31:01+00:00 [Note] [Entrypoint]: Creating database myprojectdb
database_1 | 2021-12-25 15:31:01+00:00 [Note] [Entrypoint]: Creating user myproject
database_1 | 2021-12-25 15:31:01+00:00 [Note] [Entrypoint]: Giving user myproject access to schema myprojectdb
database_1 |
database_1 | 2021-12-25 15:31:01+00:00 [Note] [Entrypoint]: Stopping temporary server
database_1 | 2021-12-25 15:31:01 0 [Note] mysqld (initiated by: root[root] # localhost []): Normal shutdown
database_1 | 2021-12-25 15:31:01 0 [Note] InnoDB: FTS optimize thread exiting.
database_1 | 2021-12-25 15:31:01 0 [Note] InnoDB: Starting shutdown...
database_1 | 2021-12-25 15:31:01 0 [Note] InnoDB: Dumping buffer pool(s) to /var/lib/mysql/ib_buffer_pool
database_1 | 2021-12-25 15:31:01 0 [Note] InnoDB: Buffer pool(s) dump completed at 211225 15:31:01
database_1 | 2021-12-25 15:31:01 0 [Note] InnoDB: Removed temporary tablespace data file: "./ibtmp1"
database_1 | 2021-12-25 15:31:01 0 [Note] InnoDB: Shutdown completed; log sequence number 42628; transaction id 19
database_1 | 2021-12-25 15:31:01 0 [Note] mysqld: Shutdown complete
database_1 |
database_1 | 2021-12-25 15:31:02+00:00 [Note] [Entrypoint]: Temporary server stopped
database_1 |
database_1 | 2021-12-25 15:31:02+00:00 [Note] [Entrypoint]: MariaDB init process done. Ready for start up.
database_1 |
database_1 | 2021-12-25 15:31:02 0 [Note] mysqld (mysqld 10.6.1-MariaDB-1:10.6.1+maria~focal) starting as process 1 ...
database_1 | 2021-12-25 15:31:02 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
database_1 | 2021-12-25 15:31:02 0 [Note] InnoDB: Number of pools: 1
database_1 | 2021-12-25 15:31:02 0 [Note] InnoDB: Using crc32 + pclmulqdq instructions
database_1 | 2021-12-25 15:31:02 0 [Note] mysqld: O_TMPFILE is not supported on /tmp (disabling future attempts)
database_1 | 2021-12-25 15:31:02 0 [Note] InnoDB: Using Linux native AIO
database_1 | 2021-12-25 15:31:02 0 [Note] InnoDB: Initializing buffer pool, total size = 134217728, chunk size = 134217728
database_1 | 2021-12-25 15:31:02 0 [Note] InnoDB: Completed initialization of buffer pool
database_1 | 2021-12-25 15:31:02 0 [Note] InnoDB: 128 rollback segments are active.
database_1 | 2021-12-25 15:31:02 0 [Note] InnoDB: Creating shared tablespace for temporary tables
database_1 | 2021-12-25 15:31:02 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
database_1 | 2021-12-25 15:31:02 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
database_1 | 2021-12-25 15:31:02 0 [Note] InnoDB: 10.6.1 started; log sequence number 42628; transaction id 18
database_1 | 2021-12-25 15:31:02 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
database_1 | 2021-12-25 15:31:02 0 [Note] Plugin 'FEEDBACK' is disabled.
database_1 | 2021-12-25 15:31:02 0 [Warning] You need to use --log-bin to make --expire-logs-days or --binlog-expire-logs-seconds work.
database_1 | 2021-12-25 15:31:02 0 [Note] Server socket created on IP: '0.0.0.0'.
database_1 | 2021-12-25 15:31:02 0 [Note] Server socket created on IP: '::'.
database_1 | 2021-12-25 15:31:02 0 [Warning] 'proxies_priv' entry '#% root#66d18f02ea8a' ignored in --skip-name-resolve mode.
database_1 | 2021-12-25 15:31:02 0 [Note] InnoDB: Buffer pool(s) load completed at 211225 15:31:02
database_1 | 2021-12-25 15:31:02 0 [Note] mysqld: ready for connections.
database_1 | Version: '10.6.1-MariaDB-1:10.6.1+maria~focal' socket: '/run/mysqld/mysqld.sock' port: 3306 mariadb.org binary distribution
It looks to me as if the .env-parameters are not given to the database-container anymore. All attempts recreating the database-container with docker-compose build, or removing all images via docker image prune and docker-compose pull have been in vain. I have updated my OS from 21.04 to 21.10 two days ago, but I don't think it causes the issue (just stated it here if it does). Does someone has an idea on how to fix this? Setting the MYSQL_ROOT_PASSWORD directly in the docker-compose.yml did not help either. The permission on database_persist are set via sudo chown -R $USER:$USER database_persist/ so that should not be an issue as well.
Thanks (and merry Christmas :) )
Edit: I tried reinstalling docker and updating docker-compose to version 2.2.2 (edited accordingly), but it had no effect. One of the commentors asked if I can connect to the container. Yes, I can, but not as root.
The .env file can be parsed as a part of the docker-compose.yaml. Though I personally never used this the way you do, as you can also pass a file directly into the container. With the env_file key
version: '3'
services:
database:
env_file: .env
image: mariadb:10.6.1
ports:
- "${DB_EXPOSE_PORT}:3306"
volumes:
- "./database_persist:/var/lib/mysqldata"
Obviously, you then also need to change the variable names in your .env file. And I personally would rename it to a more clear name.
Okay - for some weird reason the output stays the same, but when I try to login the dbroot and the dbuser actually use their passwords specified in the env-files. Plus using anything else will result in a "access denied". So I don't know if the update fixed the issue or if the logoutput just scared me and this is actually the expected behaviour. I will update this if I get any new insights.
Related
I have spent the last few hours debugging my system and I am at a loss as to what is going on here.
I am using a simple docker-compose.yml file to start a mariadb and an adminer instance on my Ubuntu 20.04 LTS system.
docker-compose.yml:
version: '3'
services:
database:
image: mariadb
restart: always
environment:
MYSQL_DATABASE: feedback
MYSQL_USER: db_user
MYSQL_PASSWORD: password
MYSQL_ROOT_PASSWORD: root
adminer:
image: adminer
restart: always
environment:
ADMINER_DEFAULT_SERVER: database
ports:
- "127.0.0.1:8080:8080"
A coworker tested this and it works 100% of the time on their system. However, it only worked twice out of many, many tries in the last few hours one my system.
This is the docker-compose output:
Creating knowledge-base_database_1 ... done
Creating knowledge-base_adminer_1 ... done
Attaching to knowledge-base_adminer_1, knowledge-base_database_1
database_1 | 2021-05-31 12:17:04+00:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:10.5.10+maria~focal started.
adminer_1 | [Mon May 31 12:17:04 2021] PHP 7.4.19 Development Server (http://[::]:8080) started
database_1 | 2021-05-31 12:17:04+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
database_1 | 2021-05-31 12:17:04+00:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:10.5.10+maria~focal started.
database_1 | 2021-05-31 12:17:05+00:00 [Note] [Entrypoint]: Initializing database files
database_1 |
database_1 |
database_1 | PLEASE REMEMBER TO SET A PASSWORD FOR THE MariaDB root USER !
database_1 | To do so, start the server, then issue the following command:
database_1 |
database_1 | '/usr/bin/mysql_secure_installation'
database_1 |
database_1 | which will also give you the option of removing the test
database_1 | databases and anonymous user created by default. This is
database_1 | strongly recommended for production servers.
database_1 |
database_1 | See the MariaDB Knowledgebase at https://mariadb.com/kb or the
database_1 | MySQL manual for more instructions.
database_1 |
database_1 | Please report any problems at https://mariadb.org/jira
database_1 |
database_1 | The latest information about MariaDB is available at https://mariadb.org/.
database_1 | You can find additional information about the MySQL part at:
database_1 | https://dev.mysql.com
database_1 | Consider joining MariaDB's strong and vibrant community:
database_1 | https://mariadb.org/get-involved/
database_1 |
database_1 | 2021-05-31 12:17:06+00:00 [Note] [Entrypoint]: Database files initialized
database_1 | 2021-05-31 12:17:06+00:00 [Note] [Entrypoint]: Starting temporary server
database_1 | 2021-05-31 12:17:06+00:00 [Note] [Entrypoint]: Waiting for server startup
database_1 | 2021-05-31 12:17:06 0 [Note] mysqld (mysqld 10.5.10-MariaDB-1:10.5.10+maria~focal) starting as process 99 ...
database_1 | 2021-05-31 12:17:06 0 [Note] InnoDB: Uses event mutexes
database_1 | 2021-05-31 12:17:06 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
database_1 | 2021-05-31 12:17:06 0 [Note] InnoDB: Number of pools: 1
database_1 | 2021-05-31 12:17:06 0 [Note] InnoDB: Using crc32 + pclmulqdq instructions
database_1 | 2021-05-31 12:17:06 0 [Note] mysqld: O_TMPFILE is not supported on /tmp (disabling future attempts)
database_1 | 2021-05-31 12:17:06 0 [Note] InnoDB: Using Linux native AIO
database_1 | 2021-05-31 12:17:06 0 [Note] InnoDB: Initializing buffer pool, total size = 134217728, chunk size = 134217728
database_1 | 2021-05-31 12:17:06 0 [Note] InnoDB: Completed initialization of buffer pool
database_1 | 2021-05-31 12:17:06 0 [Note] InnoDB: 128 rollback segments are active.
database_1 | 2021-05-31 12:17:06 0 [Note] InnoDB: Creating shared tablespace for temporary tables
database_1 | 2021-05-31 12:17:06 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
database_1 | 2021-05-31 12:17:06 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
database_1 | 2021-05-31 12:17:06 0 [Note] InnoDB: 10.5.10 started; log sequence number 45118; transaction id 20
database_1 | 2021-05-31 12:17:06 0 [Note] Plugin 'FEEDBACK' is disabled.
database_1 | 2021-05-31 12:17:06 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
database_1 | 2021-05-31 12:17:06 0 [Note] InnoDB: Buffer pool(s) load completed at 210531 12:17:06
database_1 | 2021-05-31 12:17:06 0 [Warning] 'user' entry 'root#5315aa145a33' ignored in --skip-name-resolve mode.
database_1 | 2021-05-31 12:17:06 0 [Warning] 'proxies_priv' entry '#% root#5315aa145a33' ignored in --skip-name-resolve mode.
database_1 | 2021-05-31 12:17:06 0 [Note] Reading of all Master_info entries succeeded
database_1 | 2021-05-31 12:17:06 0 [Note] Added new Master_info '' to hash table
database_1 | 2021-05-31 12:17:06 0 [Note] mysqld: ready for connections.
database_1 | Version: '10.5.10-MariaDB-1:10.5.10+maria~focal' socket: '/run/mysqld/mysqld.sock' port: 0 mariadb.org binary distribution
database_1 | 2021-05-31 12:17:07+00:00 [Note] [Entrypoint]: Temporary server started.
database_1 | Warning: Unable to load '/usr/share/zoneinfo/leap-seconds.list' as time zone. Skipping it.
database_1 | Warning: Unable to load '/usr/share/zoneinfo/leapseconds' as time zone. Skipping it.
database_1 | Warning: Unable to load '/usr/share/zoneinfo/tzdata.zi' as time zone. Skipping it.
database_1 | 2021-05-31 12:17:09 5 [Warning] 'proxies_priv' entry '#% root#5315aa145a33' ignored in --skip-name-resolve mode.
database_1 | 2021-05-31 12:17:09+00:00 [Note] [Entrypoint]: Creating database feedback
database_1 | 2021-05-31 12:17:09+00:00 [Note] [Entrypoint]: Creating user db_user
database_1 | 2021-05-31 12:17:09+00:00 [Note] [Entrypoint]: Giving user db_user access to schema feedback
database_1 |
database_1 | 2021-05-31 12:17:09+00:00 [Note] [Entrypoint]: Stopping temporary server
database_1 | 2021-05-31 12:17:09 0 [Note] mysqld (initiated by: root[root] # localhost []): Normal shutdown
database_1 | 2021-05-31 12:17:09 0 [Note] Event Scheduler: Purging the queue. 0 events
database_1 | 2021-05-31 12:17:09 0 [Note] InnoDB: FTS optimize thread exiting.
database_1 | 2021-05-31 12:17:09 0 [Note] InnoDB: Starting shutdown...
database_1 | 2021-05-31 12:17:09 0 [Note] InnoDB: Dumping buffer pool(s) to /var/lib/mysql/ib_buffer_pool
database_1 | 2021-05-31 12:17:09 0 [Note] InnoDB: Buffer pool(s) dump completed at 210531 12:17:09
database_1 | 2021-05-31 12:17:09 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
database_1 | 2021-05-31 12:17:09 0 [Note] InnoDB: Shutdown completed; log sequence number 45130; transaction id 21
database_1 | 2021-05-31 12:17:09 0 [Note] mysqld: Shutdown complete
database_1 |
database_1 | 2021-05-31 12:17:10+00:00 [Note] [Entrypoint]: Temporary server stopped
database_1 |
database_1 | 2021-05-31 12:17:10+00:00 [Note] [Entrypoint]: MariaDB init process done. Ready for start up.
database_1 |
database_1 | 2021-05-31 12:17:10 0 [Note] mysqld (mysqld 10.5.10-MariaDB-1:10.5.10+maria~focal) starting as process 1 ...
database_1 | 2021-05-31 12:17:10 0 [Note] InnoDB: Uses event mutexes
database_1 | 2021-05-31 12:17:10 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
database_1 | 2021-05-31 12:17:10 0 [Note] InnoDB: Number of pools: 1
database_1 | 2021-05-31 12:17:10 0 [Note] InnoDB: Using crc32 + pclmulqdq instructions
database_1 | 2021-05-31 12:17:10 0 [Note] mysqld: O_TMPFILE is not supported on /tmp (disabling future attempts)
database_1 | 2021-05-31 12:17:10 0 [Note] InnoDB: Using Linux native AIO
database_1 | 2021-05-31 12:17:10 0 [Note] InnoDB: Initializing buffer pool, total size = 134217728, chunk size = 134217728
database_1 | 2021-05-31 12:17:10 0 [Note] InnoDB: Completed initialization of buffer pool
database_1 | 2021-05-31 12:17:10 0 [Note] InnoDB: 128 rollback segments are active.
database_1 | 2021-05-31 12:17:10 0 [Note] InnoDB: Creating shared tablespace for temporary tables
database_1 | 2021-05-31 12:17:10 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
database_1 | 2021-05-31 12:17:10 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
database_1 | 2021-05-31 12:17:10 0 [Note] InnoDB: 10.5.10 started; log sequence number 45130; transaction id 20
database_1 | 2021-05-31 12:17:10 0 [Note] Plugin 'FEEDBACK' is disabled.
database_1 | 2021-05-31 12:17:10 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
database_1 | 2021-05-31 12:17:10 0 [Note] InnoDB: Buffer pool(s) load completed at 210531 12:17:10
database_1 | 2021-05-31 12:17:10 0 [Note] Server socket created on IP: '::'.
database_1 | 2021-05-31 12:17:10 0 [Warning] 'proxies_priv' entry '#% root#5315aa145a33' ignored in --skip-name-resolve mode.
database_1 | 2021-05-31 12:17:10 0 [Note] Reading of all Master_info entries succeeded
database_1 | 2021-05-31 12:17:10 0 [Note] Added new Master_info '' to hash table
database_1 | 2021-05-31 12:17:10 0 [Note] mysqld: ready for connections.
database_1 | Version: '10.5.10-MariaDB-1:10.5.10+maria~focal' socket: '/run/mysqld/mysqld.sock' port: 3306 mariadb.org binary distribution
Trying to log into the database with adminer using root:root produces the following output:
adminer_1 | [Mon May 31 12:17:54 2021] [::ffff:172.25.0.1]:38170 Accepted
adminer_1 | [Mon May 31 12:17:54 2021] [::ffff:172.25.0.1]:38170 [302]: POST /?server=database&username=root
adminer_1 | [Mon May 31 12:17:54 2021] [::ffff:172.25.0.1]:38170 Closing
adminer_1 | [Mon May 31 12:17:54 2021] [::ffff:172.25.0.1]:38174 Accepted
adminer_1 | [Mon May 31 12:18:24 2021] [::ffff:172.25.0.1]:38174 [403]: GET /?server=database&username=root
adminer_1 | [Mon May 31 12:18:24 2021] [::ffff:172.25.0.1]:38174 Closing
adminer_1 | [Mon May 31 12:18:24 2021] [::ffff:172.25.0.1]:38208 Accepted
adminer_1 | [Mon May 31 12:18:24 2021] [::ffff:172.25.0.1]:38208 [200]: GET /?file=favicon.ico&version=4.8.0
adminer_1 | [Mon May 31 12:18:24 2021] [::ffff:172.25.0.1]:38208 Closing
I have tried disabling my firewall, reinstalling docker and docker-compose, creating a custom network with docker instead of using docker-compose's default network, etc.
I also started a known-working project on my system, which yielded the same results. Something on my system seems to be broken, but I don't know where to look anymore.
Does anyone have any ideas what I can try to get this working?
Try appending /index.php so instead of http://localhost go to http://localhost/index.php
I am attempting to have my docker db container automatically populate the database with a dataset when created. According to the mariadb documentation, there is an docker-entrypoint-initdb.d folder in the volume that can be used for this purpose.
I set up my docker-compose.yml file to mirror examples that I have found on StackOverflow, but am still unable to get my SQL scripts to execute. Here are the relevant pieces of my docker-compose.yml file:
version: '3.6'
services:
db:
image: mariadb:10.5.4-focal
container_name: db
volumes:
- ./cms/conf/mysql/data/:/var/lib/mysql/:rw
- ./cms/sql/:/docker-entrypoint-initdb.d/:ro
environment:
- MYSQL_ROOT_PASSWORD=password
- MYSQL_USER=root
- MYSQL_PASSWORD=password
- MYSQL_DATABASE=wordpress
restart: always
adminer:
image: adminer:4.7.7-standalone
container_name: adminer
links:
- db
ports:
- 8080:8080
restart: always
Next to the docker-compose.yml file, I have a cms/sql/init.sql file with the following contents:
CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test` /*!40100 DEFAULT CHARACTER SET utf8mb4 */;
USE `test`;
Prior to each test iteration, I clean up any old/cached Docker content:
$ docker-compose down -v I've found this doesn't actually remove the db volumes. Running a docker volume ls still shows past volumes present.
$ docker volume prune This clears out the volumes. Running docker volume ls after running this shows an empty list.
$ rm -rf ./cms/conf/mysql This cleans out any actual filesystem changes that the db container made.
$ docker-compose up -d --build To rebuild the containers. This should trigger my initialization SQL scripts.
Docker runs, and the db container gets successfully created. I am able to access the adminer container running on localhost:8080. I am able to log in as the root user with the password specified in the docker-compose.yml file.
The Adminer interface shows the standard MySQL databases (information_schema, mysql, performance_schema) and additionally shows the wordpress database defined in the MYSQL_DATABASE value of the docker-compose.yml file. But my test database from the init.sql is nowhere to be found.
I found some other similar StackOverflow questions that have had similar problems. I've followed the accepted answers, and am still unable to get any SQL scripts to get executed.
docker-compose.yml, postgress, how to setup db, tables and prepop in an init.sql file?
Issue with docker compose initial DB setup once
mySQL init scripts not running with docker-compose
Create database on docker-compose startup
Here's the Docker log from my db container. I didn't see anything that looked strange; no error messages about initialization, etc:
2020-07-15 19:21:34+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 1:10.5.4+maria~focal started.
2020-07-15 19:21:35+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
2020-07-15 19:21:35+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 1:10.5.4+maria~focal started.
2020-07-15 19:21:35+00:00 [Note] [Entrypoint]: Initializing database files
PLEASE REMEMBER TO SET A PASSWORD FOR THE MariaDB root USER !
To do so, start the server, then issue the following commands:
'/usr/bin/mysqladmin' -u root password 'new-password'
'/usr/bin/mysqladmin' -u root -h password 'new-password'
Alternatively you can run:
'/usr/bin/mysql_secure_installation'
which will also give you the option of removing the test
databases and anonymous user created by default. This is
strongly recommended for production servers.
See the MariaDB Knowledgebase at https://mariadb.com/kb or the
MySQL manual for more instructions.
Please report any problems at https://mariadb.org/jira
The latest information about MariaDB is available at https://mariadb.org/.
You can find additional information about the MySQL part at:
https://dev.mysql.com
Consider joining MariaDB's strong and vibrant community:
https://mariadb.org/get-involved/
2020-07-15 19:21:47+00:00 [Note] [Entrypoint]: Database files initialized
2020-07-15 19:21:47+00:00 [Note] [Entrypoint]: Starting temporary server
2020-07-15 19:21:47+00:00 [Note] [Entrypoint]: Waiting for server startup
2020-07-15 19:21:47 0 [Note] mysqld (mysqld 10.5.4-MariaDB-1:10.5.4+maria~focal) starting as process 107 ...
2020-07-15 19:21:47 0 [Note] InnoDB: Using Linux native AIO
2020-07-15 19:21:47 0 [Note] InnoDB: Uses event mutexes
2020-07-15 19:21:47 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2020-07-15 19:21:47 0 [Note] InnoDB: Number of pools: 1
2020-07-15 19:21:47 0 [Note] InnoDB: Using SSE4.2 crc32 instructions
2020-07-15 19:21:47 0 [Note] mysqld: O_TMPFILE is not supported on /tmp (disabling future attempts)
2020-07-15 19:21:47 0 [Note] InnoDB: Initializing buffer pool, total size = 134217728, chunk size = 134217728
2020-07-15 19:21:47 0 [Note] InnoDB: Completed initialization of buffer pool
2020-07-15 19:21:47 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2020-07-15 19:21:48 0 [Note] InnoDB: 128 rollback segments are active.
2020-07-15 19:21:48 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2020-07-15 19:21:48 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2020-07-15 19:21:49 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2020-07-15 19:21:49 0 [Note] InnoDB: 10.5.4 started; log sequence number 45041; transaction id 21
2020-07-15 19:21:49 0 [Note] Plugin 'FEEDBACK' is disabled.
2020-07-15 19:21:49 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
2020-07-15 19:21:49 0 [Note] InnoDB: Buffer pool(s) load completed at 200715 19:21:49
2020-07-15 19:21:49 0 [Warning] 'user' entry 'root#5666e0d8e52e' ignored in --skip-name-resolve mode.
2020-07-15 19:21:49 0 [Warning] 'user' entry '#5666e0d8e52e' ignored in --skip-name-resolve mode.
2020-07-15 19:21:49 0 [Warning] 'proxies_priv' entry '#% root#5666e0d8e52e' ignored in --skip-name-resolve mode.
2020-07-15 19:21:49 0 [Note] Reading of all Master_info entries succeeded
2020-07-15 19:21:49 0 [Note] Added new Master_info '' to hash table
2020-07-15 19:21:49 0 [Note] mysqld: ready for connections.
Version: '10.5.4-MariaDB-1:10.5.4+maria~focal' socket: '/run/mysqld/mysqld.sock' port: 0 mariadb.org binary distribution
2020-07-15 19:21:49+00:00 [Note] [Entrypoint]: Temporary server started.
Warning: Unable to load '/usr/share/zoneinfo/leap-seconds.list' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/leapseconds' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/tzdata.zi' as time zone. Skipping it.
2020-07-15 19:21:58 5 [Warning] 'proxies_priv' entry '#% root#5666e0d8e52e' ignored in --skip-name-resolve mode.
2020-07-15 19:21:58+00:00 [Note] [Entrypoint]: Creating database wordpress23
2020-07-15 19:21:58+00:00 [Note] [Entrypoint]: Creating user root
ERROR 1396 (HY000) at line 1: Operation CREATE USER failed for 'root'#'%'
2020-07-15 19:21:34+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 1:10.5.4+maria~focal started.
2020-07-15 19:21:35+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
2020-07-15 19:21:35+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 1:10.5.4+maria~focal started.
2020-07-15 19:21:35+00:00 [Note] [Entrypoint]: Initializing database files
PLEASE REMEMBER TO SET A PASSWORD FOR THE MariaDB root USER !
To do so, start the server, then issue the following commands:
'/usr/bin/mysqladmin' -u root password 'new-password'
'/usr/bin/mysqladmin' -u root -h password 'new-password'
Alternatively you can run:
'/usr/bin/mysql_secure_installation'
which will also give you the option of removing the test
databases and anonymous user created by default. This is
strongly recommended for production servers.
See the MariaDB Knowledgebase at https://mariadb.com/kb or the
MySQL manual for more instructions.
Please report any problems at https://mariadb.org/jira
The latest information about MariaDB is available at https://mariadb.org/.
You can find additional information about the MySQL part at:
https://dev.mysql.com
Consider joining MariaDB's strong and vibrant community:
https://mariadb.org/get-involved/
2020-07-15 19:21:47+00:00 [Note] [Entrypoint]: Database files initialized
2020-07-15 19:21:47+00:00 [Note] [Entrypoint]: Starting temporary server
2020-07-15 19:21:47+00:00 [Note] [Entrypoint]: Waiting for server startup
2020-07-15 19:21:47 0 [Note] mysqld (mysqld 10.5.4-MariaDB-1:10.5.4+maria~focal) starting as process 107 ...
2020-07-15 19:21:47 0 [Note] InnoDB: Using Linux native AIO
2020-07-15 19:21:47 0 [Note] InnoDB: Uses event mutexes
2020-07-15 19:21:47 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2020-07-15 19:21:47 0 [Note] InnoDB: Number of pools: 1
2020-07-15 19:21:47 0 [Note] InnoDB: Using SSE4.2 crc32 instructions
2020-07-15 19:21:47 0 [Note] mysqld: O_TMPFILE is not supported on /tmp (disabling future attempts)
2020-07-15 19:21:47 0 [Note] InnoDB: Initializing buffer pool, total size = 134217728, chunk size = 134217728
2020-07-15 19:21:47 0 [Note] InnoDB: Completed initialization of buffer pool
2020-07-15 19:21:47 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2020-07-15 19:21:48 0 [Note] InnoDB: 128 rollback segments are active.
2020-07-15 19:21:48 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2020-07-15 19:21:48 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2020-07-15 19:21:49 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2020-07-15 19:21:49 0 [Note] InnoDB: 10.5.4 started; log sequence number 45041; transaction id 21
2020-07-15 19:21:49 0 [Note] Plugin 'FEEDBACK' is disabled.
2020-07-15 19:21:49 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
2020-07-15 19:21:49 0 [Note] InnoDB: Buffer pool(s) load completed at 200715 19:21:49
2020-07-15 19:21:49 0 [Warning] 'user' entry 'root#5666e0d8e52e' ignored in --skip-name-resolve mode.
2020-07-15 19:21:49 0 [Warning] 'user' entry '#5666e0d8e52e' ignored in --skip-name-resolve mode.
2020-07-15 19:21:49 0 [Warning] 'proxies_priv' entry '#% root#5666e0d8e52e' ignored in --skip-name-resolve mode.
2020-07-15 19:21:49 0 [Note] Reading of all Master_info entries succeeded
2020-07-15 19:21:49 0 [Note] Added new Master_info '' to hash table
2020-07-15 19:21:49 0 [Note] mysqld: ready for connections.
Version: '10.5.4-MariaDB-1:10.5.4+maria~focal' socket: '/run/mysqld/mysqld.sock' port: 0 mariadb.org binary distribution
2020-07-15 19:21:49+00:00 [Note] [Entrypoint]: Temporary server started.
Warning: Unable to load '/usr/share/zoneinfo/leap-seconds.list' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/leapseconds' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/tzdata.zi' as time zone. Skipping it.
2020-07-15 19:21:58 5 [Warning] 'proxies_priv' entry '#% root#5666e0d8e52e' ignored in --skip-name-resolve mode.
2020-07-15 19:21:58+00:00 [Note] [Entrypoint]: Creating database wordpress
2020-07-15 19:21:58+00:00 [Note] [Entrypoint]: Creating user root
ERROR 1396 (HY000) at line 1: Operation CREATE USER failed for 'root'#'%'
2020-07-15 19:21:59+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 1:10.5.4+maria~focal started.
2020-07-15 19:22:00+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
2020-07-15 19:22:00+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 1:10.5.4+maria~focal started.
2020-07-15 19:22:01 0 [Note] mysqld (mysqld 10.5.4-MariaDB-1:10.5.4+maria~focal) starting as process 1 ...
2020-07-15 19:22:01 0 [Note] mysqld: Aria engine: starting recovery
recovered pages: 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100% (0.3 seconds); tables to flush: 4 3 2 1 0
(0.0 seconds);
2020-07-15 19:22:01 0 [Note] mysqld: Aria engine: recovery done
2020-07-15 19:22:01 0 [Note] InnoDB: Using Linux native AIO
2020-07-15 19:22:01 0 [Note] InnoDB: Uses event mutexes
2020-07-15 19:22:01 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2020-07-15 19:22:01 0 [Note] InnoDB: Number of pools: 1
2020-07-15 19:22:01 0 [Note] InnoDB: Using SSE4.2 crc32 instructions
2020-07-15 19:22:01 0 [Note] mysqld: O_TMPFILE is not supported on /tmp (disabling future attempts)
2020-07-15 19:22:01 0 [Note] InnoDB: Initializing buffer pool, total size = 134217728, chunk size = 134217728
2020-07-15 19:22:01 0 [Note] InnoDB: Completed initialization of buffer pool
2020-07-15 19:22:01 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2020-07-15 19:22:01 0 [Note] InnoDB: Starting crash recovery from checkpoint LSN=45069
2020-07-15 19:22:01 0 [Note] InnoDB: 128 rollback segments are active.
2020-07-15 19:22:01 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
2020-07-15 19:22:01 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2020-07-15 19:22:01 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2020-07-15 19:22:02 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2020-07-15 19:22:02 0 [Note] InnoDB: 10.5.4 started; log sequence number 45081; transaction id 21
2020-07-15 19:22:02 0 [Note] Plugin 'FEEDBACK' is disabled.
2020-07-15 19:22:02 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
2020-07-15 19:22:02 0 [Note] InnoDB: Buffer pool(s) load completed at 200715 19:22:02
2020-07-15 19:22:02 0 [Note] Server socket created on IP: '::'.
2020-07-15 19:22:02 0 [Warning] 'proxies_priv' entry '#% root#5666e0d8e52e' ignored in --skip-name-resolve mode.
2020-07-15 19:22:02 0 [Note] Reading of all Master_info entries succeeded
2020-07-15 19:22:02 0 [Note] Added new Master_info '' to hash table
2020-07-15 19:22:02 0 [Note] mysqld: ready for connections.
Version: '10.5.4-MariaDB-1:10.5.4+maria~focal' socket: '/run/mysqld/mysqld.sock' port: 3306 mariadb.org binary distribution
[Edit]
I logged into the CLI for the db container, and verified that my init.sql script is in the docker-entrypoint-initdb.d folder:
$ cd docker-entrypoint-initdb.d
$ ls
init.sql
$ pwd
/docker-entrypoint-initdb.d
Anyone have any ideas on what else to check?
I faced an identical issue and I investigated the logs more closely.
I wasn't sure if the following error was related but I decided to get rid of it.
ERROR 1396 (HY000) at line 1: Operation CREATE USER failed for 'root'#'%'
It seems that root user is created by default so I changed the environment variable of the user to user for example instead of root:
MYSQL_USER: user
After that I built and run the docker-compose.yml file and the SQL scripts executed succesfuly.
I had to reset the data volume otherwise the entry script would not trigger. In this case you would have to delete all contents:
sudo rm -rf /cms/conf/mysql/data/
I am trying to create a hybrid container.
Following is my docker-compose file.
version: "2"
services:
database:
build:
context: ./registration-database
image: registration-database
# set default mysql root password, change as needed
environment:
MYSQL_ROOT_PASSWORD: password
# Expose port 3306 to host.
ports:
- "3306:3306"
restart: always
webserver:
build:
context: ./registration-webserver
image: registration-webserver
# mount point for application in tomcat
volumes:
- ./app/target/UserSignup:/usr/local/tomcat/webapps/UserSignup
links:
- database:registration-database
# open ports for tomcat and remote debugging
ports:
- "8080:8080"
- "8000:8000"
restart: always
Following is the dockerFile for mysql:
FROM mysql:5.7
# Copy the database initialize script:
# Contents of /docker-entrypoint-initdb.d are run on mysqld startup
ADD docker-entrypoint-initdb.d/ /docker-entrypoint-initdb.d/
ENV MYSQL_DATABASE=ishan
ENV MYSQL_USER=ishan
ENV MYSQL_PASSWORD=password
Following is the initialize_db.sql file
USE `ishan`;
CREATE TABLE `user` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`dateOfBirth` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ,
`emailAddress` varchar(255) NOT NULL,
`firstName` varchar(255) NOT NULL,
`lastName` varchar(255) NOT NULL,
`password` varchar(8) NOT NULL,
`userName` varchar(20) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=43 DEFAULT CHARSET=latin1;
Earlier when I was running the command docker-compose up it was creating the user ishan and it was creating the user table also. But now, suddenly something happened although the mysql is getting installed with the root user but the new user (ishan) and the table is not getting created. Any help is appreciated.
Following is the log which is getting printed on startup:
Starting app_database_1 ... done
Starting app_webserver_1 ... done
Attaching to app_database_1, app_webserver_1
database_1 | 2019-04-09T08:30:51.326732Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
database_1 | 2019-04-09T08:30:51.327850Z 0 [Note] mysqld (mysqld 5.7.25) starting as process 1 ...
database_1 | 2019-04-09T08:30:51.330081Z 0 [Note] InnoDB: PUNCH HOLE support available
database_1 | 2019-04-09T08:30:51.330114Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
database_1 | 2019-04-09T08:30:51.330118Z 0 [Note] InnoDB: Uses event mutexes
database_1 | 2019-04-09T08:30:51.330121Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
database_1 | 2019-04-09T08:30:51.330125Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
database_1 | 2019-04-09T08:30:51.330127Z 0 [Note] InnoDB: Using Linux native AIO
database_1 | 2019-04-09T08:30:51.330295Z 0 [Note] InnoDB: Number of pools: 1
database_1 | 2019-04-09T08:30:51.330382Z 0 [Note] InnoDB: Using CPU crc32 instructions
database_1 | 2019-04-09T08:30:51.331394Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
database_1 | 2019-04-09T08:30:51.336481Z 0 [Note] InnoDB: Completed initialization of buffer pool
database_1 | 2019-04-09T08:30:51.338022Z 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 | 2019-04-09T08:30:51.356556Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
database_1 | 2019-04-09T08:30:51.372677Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
database_1 | 2019-04-09T08:30:51.372933Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
database_1 | 2019-04-09T08:30:51.398496Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
database_1 | 2019-04-09T08:30:51.399884Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
database_1 | 2019-04-09T08:30:51.399990Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
database_1 | 2019-04-09T08:30:51.400792Z 0 [Note] InnoDB: 5.7.25 started; log sequence number 12359503
database_1 | 2019-04-09T08:30:51.401039Z 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
database_1 | 2019-04-09T08:30:51.401382Z 0 [Note] Plugin 'FEDERATED' is disabled.
database_1 | 2019-04-09T08:30:51.419097Z 0 [Note] Found ca.pem, server-cert.pem and server-key.pem in data directory. Trying to enable SSL support using them.
database_1 | 2019-04-09T08:30:51.421195Z 0 [Warning] CA certificate ca.pem is self signed.
database_1 | 2019-04-09T08:30:51.423199Z 0 [Note] Server hostname (bind-address): '*'; port: 3306
database_1 | 2019-04-09T08:30:51.423332Z 0 [Note] IPv6 is available.
database_1 | 2019-04-09T08:30:51.423468Z 0 [Note] - '::' resolves to '::';
database_1 | 2019-04-09T08:30:51.423622Z 0 [Note] Server socket created on IP: '::'.
database_1 | 2019-04-09T08:30:51.430839Z 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.
database_1 | 2019-04-09T08:30:51.434012Z 0 [Note] InnoDB: Buffer pool(s) load completed at 190409 8:30:51
database_1 | 2019-04-09T08:30:51.437767Z 0 [Warning] 'user' entry 'root#localhost' ignored in --skip-name-resolve mode.
database_1 | 2019-04-09T08:30:51.437887Z 0 [Warning] 'user' entry 'mysql.session#localhost' ignored in --skip-name-resolve mode.
database_1 | 2019-04-09T08:30:51.438037Z 0 [Warning] 'user' entry 'mysql.sys#localhost' ignored in --skip-name-resolve mode.
database_1 | 2019-04-09T08:30:51.438612Z 0 [Warning] 'db' entry 'performance_schema mysql.session#localhost' ignored in --skip-name-resolve mode.
database_1 | 2019-04-09T08:30:51.438712Z 0 [Warning] 'db' entry 'sys mysql.sys#localhost' ignored in --skip-name-resolve mode.
database_1 | 2019-04-09T08:30:51.439004Z 0 [Warning] 'proxies_priv' entry '# root#localhost' ignored in --skip-name-resolve mode.
database_1 | 2019-04-09T08:30:51.451035Z 0 [Warning] 'tables_priv' entry 'user mysql.session#localhost' ignored in --skip-name-resolve mode.
database_1 | 2019-04-09T08:30:51.451161Z 0 [Warning] 'tables_priv' entry 'sys_config mysql.sys#localhost' ignored in --skip-name-resolve mode.
database_1 | 2019-04-09T08:30:51.484566Z 0 [Note] Event Scheduler: Loaded 0 events
database_1 | 2019-04-09T08:30:51.485090Z 0 [Note] mysqld: ready for connections.
database_1 | Version: '5.7.25' socket: '/var/run/mysqld/mysqld.sock' port: 3306 MySQL Community Server (GPL)
Most probably your volume is still present and for that reason MySQL ignores the entrypoint folder. You need to delete the volume between runs to get a fresh start. Be aware that this means losing data saved in mysql in the meantime.
docker-compose down
# this will clean all volumes not in use by any containers
docker volume prune
Run docker volume ls to make sure your volume is gone and then run your docker-compose again.
I have a Windows 10 Pro PC.
I have the following in my docker compose file
database:
image: mariadb:5.5.57
ports:
- "3306:3306"
volumes:
- ./sql/:/docker-entrypoint-initdb.d/
- ./data:/var/lib/mysql
environment:
- MYSQL_ROOT_PASSWORD=root
- MYSQL_USER=rootUsr
- MYSQL_PASSWORD=rootPwd
- MYSQL_DATABASE=root_db
When I run docker-compose up - I get this error in the console
database_1 | InnoDB: 0 pages (rounded down to MB) than specified in the .cnf file:
database_1 | InnoDB: initial 640 pages, max 0 (relevant if non-zero) pages!
database_1 | 180324 17:12:47 InnoDB: Could not open or create data files.
database_1 | 180324 17:12:47 InnoDB: If you tried to add new data files, and it failed here,
database_1 | 180324 17:12:47 InnoDB: you should now edit innodb_data_file_path in my.cnf back
database_1 | 180324 17:12:47 InnoDB: to what it was, and remove the new ibdata files InnoDB created
consumer_1 | Starting the development server...
database_1 | 180324 17:12:47 InnoDB: in this failed attempt. InnoDB only wrote those files full of
database_1 | 180324 17:12:47 InnoDB: zeros, but did not yet use them in any way. But be careful: do not
database_1 | 180324 17:12:47 InnoDB: remove old data files which contain your precious data!
database_1 | 180324 17:12:47 [ERROR] Plugin 'InnoDB' init function returned error.
database_1 | 180324 17:12:47 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
database_1 | 180324 17:12:47 [Note] Plugin 'FEEDBACK' is disabled.
database_1 | 180324 17:12:47 [ERROR] Unknown/unsupported storage engine: InnoDB
database_1 | 180324 17:12:47 [ERROR] Aborting
Do I need to do anything else to get maria db running in docker?
Update
I have tried deleting all the volumes and doing a rebuild but I still get the same error as below
Deleted the volumes from the compose file and it worked fine.
Update
Tried the same docker compose file on an Amazon EC2 instance and it worked fine the first time around
I'm learning about docker secrets to be used to store the mysql password for my lamp container stack. I am running docker for Windows 17.06.0-ce-win18 (12627).
I followed these steps:
1 - Created secret in docker as follows:
echo password | docker secret create mysql_db_root -
2 - Created the compose file shown below:
version: "3.1"
services:
apachephp:
image: apachephp
deploy:
replicas: 1
# restart_policy:
# condition: on-failure
resources:
limits:
cpus: "0.1"
memory: 50M
ports:
- "80:80"
- "443:443"
volumes:
- C:\Users\Daniel\Desktop\Learning\DockerStuff\phpdev\www:/var/www/html
networks:
- webnet
db:
image: mysql:latest
ports:
- "3306:3306"
volumes:
- C:\Users\Daniel\Desktop\Learning\DockerStuff\phpdev\db:/var/lib/mysql
secrets:
- mysql_db_root
environment:
MYSQL_ROOT_PASSWORD_FILE: /run/secrets/mysql_db_root
#MYSQL_ROOT_PASSWORD: "password"
networks:
- webnet
adminer:
image: adminer
ports:
- 8080:8080
networks:
- webnet
secrets:
mysql_db_root:
external: true
networks:
webnet:
3 - Checked to ensure secret is available inside mysql container
C:\Learning\DockerStuff\phpdev>docker exec -it 452 bash
root#45278a63bc6b:/# cat /run/secrets/mysql_db_root
password
4 - So the password is available, now try to login to mysql:
root#45278a63bc6b:/# mysql
root#45278a63bc6b:/# mysql -u root -p -h localhost
Enter password:
ERROR 1045 (28000): Access denied for user 'root'#'localhost' (using password: YES)
And the password "password" does not work! Can anyonoe shed any light on this? Thanks in advance!
The mysql container log is below:
lampstack_db.1.wgofhqdl1v33#moby | Initializing database
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:16.743604Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:17.468430Z 0 [Warning] InnoDB: New log files created, LSN=45790
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:17.563991Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:17.574436Z 0 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: 207c7b19-5cda-11e7-854a-02420aff0004.
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:17.578567Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:17.584520Z 1 [Warning] root#localhost is created with an empty password ! Please consider switching off the --initialize-insecure option.
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:20.354931Z 1 [Warning] 'user' entry 'root#localhost' ignored in --skip-name-resolve mode.
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:20.354971Z 1 [Warning] 'user' entry 'mysql.sys#localhost' ignored in --skip-name-resolve mode.
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:20.354980Z 1 [Warning] 'db' entry 'sys mysql.sys#localhost' ignored in --skip-name-resolve mode.
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:20.354987Z 1 [Warning] 'proxies_priv' entry '# root#localhost' ignored in --skip-name-resolve mode.
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:20.355007Z 1 [Warning] 'tables_priv' entry 'sys_config mysql.sys#localhost' ignored in --skip-name-resolve mode.
lampstack_db.1.wgofhqdl1v33#moby | Database initialized
lampstack_db.1.wgofhqdl1v33#moby | Initializing certificates
lampstack_db.1.wgofhqdl1v33#moby | Generating a 2048 bit RSA private key
lampstack_db.1.wgofhqdl1v33#moby | ..............................................................................................+++
lampstack_db.1.wgofhqdl1v33#moby | ...............+++
lampstack_db.1.wgofhqdl1v33#moby | unable to write 'random state'
lampstack_db.1.wgofhqdl1v33#moby | writing new private key to 'ca-key.pem'
lampstack_db.1.wgofhqdl1v33#moby | -----
lampstack_db.1.wgofhqdl1v33#moby | Generating a 2048 bit RSA private key
lampstack_db.1.wgofhqdl1v33#moby | ..............................+++
lampstack_db.1.wgofhqdl1v33#moby | ..+++
lampstack_db.1.wgofhqdl1v33#moby | unable to write 'random state'
lampstack_db.1.wgofhqdl1v33#moby | writing new private key to 'server-key.pem'
lampstack_db.1.wgofhqdl1v33#moby | -----
lampstack_db.1.wgofhqdl1v33#moby | Generating a 2048 bit RSA private key
lampstack_db.1.wgofhqdl1v33#moby | ............+++
lampstack_db.1.wgofhqdl1v33#moby | .............+++
lampstack_db.1.wgofhqdl1v33#moby | unable to write 'random state'
lampstack_db.1.wgofhqdl1v33#moby | writing new private key to 'client-key.pem'
lampstack_db.1.wgofhqdl1v33#moby | -----
lampstack_db.1.wgofhqdl1v33#moby | Certificates initialized
lampstack_db.1.wgofhqdl1v33#moby | MySQL init process in progress...
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:23.668312Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:23.674228Z 0 [Note] mysqld (mysqld 5.7.18) starting as process 89 ...
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:23.681123Z 0 [Note] InnoDB: PUNCH HOLE support available
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:23.681142Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:23.681145Z 0 [Note] InnoDB: Uses event mutexes
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:23.681147Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:23.681149Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.3
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:23.681151Z 0 [Note] InnoDB: Using Linux native AIO
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:23.681304Z 0 [Note] InnoDB: Number of pools: 1
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:23.681369Z 0 [Note] InnoDB: Using CPU crc32 instructions
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:23.682440Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:23.687878Z 0 [Note] InnoDB: Completed initialization of buffer pool
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:23.689386Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:23.721122Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:23.755720Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:23.756235Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:23.830478Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:23.840143Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:23.840161Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:23.840606Z 0 [Note] InnoDB: Waiting for purge to start
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:23.891432Z 0 [Note] InnoDB: 5.7.18 started; log sequence number 2535558
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:23.891977Z 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:23.892056Z 0 [Note] Plugin 'FEDERATED' is disabled.
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:23.931384Z 0 [Note] InnoDB: Buffer pool(s) load completed at 170629 14:49:23
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:23.934426Z 0 [Note] Found ca.pem, server-cert.pem and server-key.pem in data directory. Trying to enable SSL support using them.
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:23.936509Z 0 [Warning] CA certificate ca.pem is self signed.
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:23.952553Z 0 [Warning] 'user' entry 'root#localhost' ignored in --skip-name-resolve mode.
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:23.952645Z 0 [Warning] 'user' entry 'mysql.sys#localhost' ignored in --skip-name-resolve mode.
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:23.952829Z 0 [Warning] 'db' entry 'sys mysql.sys#localhost' ignored in --skip-name-resolve mode.
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:23.953123Z 0 [Warning] 'proxies_priv' entry '# root#localhost' ignored in --skip-name-resolve mode.
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:23.976984Z 0 [Warning] 'tables_priv' entry 'sys_config mysql.sys#localhost' ignored in --skip-name-resolve mode.
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:24.115430Z 0 [Note] Event Scheduler: Loaded 0 events
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:24.115572Z 0 [Note] mysqld: ready for connections.
lampstack_db.1.wgofhqdl1v33#moby | Version: '5.7.18' socket: '/var/run/mysqld/mysqld.sock' port: 0 MySQL Community Server (GPL)
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:24.115578Z 0 [Note] Executing 'SELECT * FROM INFORMATION_SCHEMA.TABLES;' to get a list of tables using the deprecated partition engine. You may use the startup option '--disable-partition-engine-check' to skip this check.
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:24.115580Z 0 [Note] Beginning of list of non-natively partitioned tables
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:24.235357Z 0 [Note] End of list of non-natively partitioned tables
lampstack_db.1.wgofhqdl1v33#moby | Warning: Unable to load '/usr/share/zoneinfo/iso3166.tab' as time zone. Skipping it.
lampstack_db.1.wgofhqdl1v33#moby | Warning: Unable to load '/usr/share/zoneinfo/leap-seconds.list' as time zone. Skipping it.
lampstack_db.1.wgofhqdl1v33#moby | Warning: Unable to load '/usr/share/zoneinfo/zone.tab' as time zone. Skipping it.
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:26.307433Z 5 [Warning] 'user' entry 'root#localhost' ignored in --skip-name-resolve mode.
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:26.307454Z 5 [Warning] 'user' entry 'mysql.sys#localhost' ignored in --skip-name-resolve mode.
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:26.307466Z 5 [Warning] 'db' entry 'sys mysql.sys#localhost' ignored in --skip-name-resolve mode.
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:26.307476Z 5 [Warning] 'proxies_priv' entry '# root#localhost' ignored in --skip-name-resolve mode.
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:26.307498Z 5 [Warning] 'tables_priv' entry 'sys_config mysql.sys#localhost' ignored in --skip-name-resolve mode.
lampstack_db.1.wgofhqdl1v33#moby |
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:26.308688Z 0 [Note] Giving 0 client threads a chance to die gracefully
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:26.308701Z 0 [Note] Shutting down slave threads
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:26.308704Z 0 [Note] Forcefully disconnecting 0 remaining clients
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:26.308706Z 0 [Note] Event Scheduler: Purging the queue. 0 events
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:26.308730Z 0 [Note] Binlog end
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:26.317357Z 0 [Note] Shutting down plugin 'ngram'
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:26.317377Z 0 [Note] Shutting down plugin 'BLACKHOLE'
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:26.317381Z 0 [Note] Shutting down plugin 'partition'
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:26.317383Z 0 [Note] Shutting down plugin 'ARCHIVE'
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:26.317385Z 0 [Note] Shutting down plugin 'INNODB_SYS_VIRTUAL'
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:26.317387Z 0 [Note] Shutting down plugin 'INNODB_SYS_DATAFILES'
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:26.317388Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLESPACES'
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:26.317389Z 0 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN_COLS'
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:26.317391Z 0 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN'
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:26.317392Z 0 [Note] Shutting down plugin 'INNODB_SYS_FIELDS'
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:26.317393Z 0 [Note] Shutting down plugin 'INNODB_SYS_COLUMNS'
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:26.317394Z 0 [Note] Shutting down plugin 'INNODB_SYS_INDEXES'
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:26.317395Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLESTATS'
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:26.317397Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLES'
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:26.317398Z 0 [Note] Shutting down plugin 'INNODB_FT_INDEX_TABLE'
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:26.317399Z 0 [Note] Shutting down plugin 'INNODB_FT_INDEX_CACHE'
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:26.317400Z 0 [Note] Shutting down plugin 'INNODB_FT_CONFIG'
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:26.317401Z 0 [Note] Shutting down plugin 'INNODB_FT_BEING_DELETED'
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:26.317403Z 0 [Note] Shutting down plugin 'INNODB_FT_DELETED'
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:26.317404Z 0 [Note] Shutting down plugin 'INNODB_FT_DEFAULT_STOPWORD'
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:26.317405Z 0 [Note] Shutting down plugin 'INNODB_METRICS'
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:26.317406Z 0 [Note] Shutting down plugin 'INNODB_TEMP_TABLE_INFO'
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:26.317408Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_POOL_STATS'
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:26.317409Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE_LRU'
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:26.317410Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE'
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:26.317411Z 0 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX_RESET'
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:26.317412Z 0 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX'
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:26.317414Z 0 [Note] Shutting down plugin 'INNODB_CMPMEM_RESET'lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:26.317415Z 0 [Note] Shutting down plugin 'INNODB_CMPMEM'
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:26.317417Z 0 [Note] Shutting down plugin 'INNODB_CMP_RESET'
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:26.317419Z 0 [Note] Shutting down plugin 'INNODB_CMP'
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:26.317421Z 0 [Note] Shutting down plugin 'INNODB_LOCK_WAITS'
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:26.317423Z 0 [Note] Shutting down plugin 'INNODB_LOCKS'
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:26.317425Z 0 [Note] Shutting down plugin 'INNODB_TRX'
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:26.317427Z 0 [Note] Shutting down plugin 'InnoDB'
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:26.317486Z 0 [Note] InnoDB: FTS optimize thread exiting.
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:26.317588Z 0 [Note] InnoDB: Starting shutdown...
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:26.418806Z 0 [Note] InnoDB: Dumping buffer pool(s) to /var/lib/mysql/ib_buffer_pool
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:26.428161Z 0 [Note] InnoDB: Buffer pool(s) dump completed at 170629 14:49:26
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:27.856347Z 0 [Note] InnoDB: Shutdown completed; log sequence number 12139694
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:27.859197Z 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:27.859225Z 0 [Note] Shutting down plugin 'MRG_MYISAM'
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:27.859229Z 0 [Note] Shutting down plugin 'MyISAM'
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:27.859239Z 0 [Note] Shutting down plugin 'CSV'
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:27.859280Z 0 [Note] Shutting down plugin 'MEMORY'
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:27.859282Z 0 [Note] Shutting down plugin 'PERFORMANCE_SCHEMA'
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:27.859306Z 0 [Note] Shutting down plugin 'sha256_password'
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:27.859312Z 0 [Note] Shutting down plugin 'mysql_native_password'
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:27.859446Z 0 [Note] Shutting down plugin 'binlog'
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:27.860931Z 0 [Note] mysqld: Shutdown complete
lampstack_db.1.wgofhqdl1v33#moby |
lampstack_db.1.wgofhqdl1v33#moby |
lampstack_db.1.wgofhqdl1v33#moby | MySQL init process done. Ready for start up.
lampstack_db.1.wgofhqdl1v33#moby |
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:28.121719Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:28.126586Z 0 [Note] mysqld (mysqld 5.7.18) starting as process 1 ...
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:28.134269Z 0 [Note] InnoDB: PUNCH HOLE support available
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:28.134297Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:28.134301Z 0 [Note] InnoDB: Uses event mutexes
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:28.134303Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:28.134305Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.3
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:28.134306Z 0 [Note] InnoDB: Using Linux native AIO
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:28.134586Z 0 [Note] InnoDB: Number of pools: 1
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:28.134962Z 0 [Note] InnoDB: Using CPU crc32 instructions
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:28.136240Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:28.142101Z 0 [Note] InnoDB: Completed initialization of buffer pool
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:28.143292Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:28.183384Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:28.242543Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:28.242892Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:28.310986Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:28.317119Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:28.317140Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:28.317361Z 0 [Note] InnoDB: Waiting for purge to start
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:28.367892Z 0 [Note] InnoDB: 5.7.18 started; log sequence number 12139694
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:28.368297Z 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:28.368339Z 0 [Note] Plugin 'FEDERATED' is disabled.
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:28.396380Z 0 [Note] Found ca.pem, server-cert.pem and server-key.pem in data directory. Trying to enable SSL support using them.
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:28.406576Z 0 [Warning] CA certificate ca.pem is self signed.
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:28.408554Z 0 [Note] Server hostname (bind-address): '*'; port: 3306
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:28.408580Z 0 [Note] IPv6 is available.
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:28.408586Z 0 [Note] - '::' resolves to '::';
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:28.408598Z 0 [Note] Server socket created on IP: '::'.
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:28.409911Z 0 [Note] InnoDB: Buffer pool(s) load completed at 170629 14:49:28
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:28.423707Z 0 [Warning] 'user' entry 'root#localhost' ignored in --skip-name-resolve mode.
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:28.423739Z 0 [Warning] 'user' entry 'mysql.sys#localhost' ignored in --skip-name-resolve mode.
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:28.423871Z 0 [Warning] 'db' entry 'sys mysql.sys#localhost' ignored in --skip-name-resolve mode.
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:28.424004Z 0 [Warning] 'proxies_priv' entry '# root#localhost' ignored in --skip-name-resolve mode.
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:28.442753Z 0 [Warning] 'tables_priv' entry 'sys_config mysql.sys#localhost' ignored in --skip-name-resolve mode.
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:28.524101Z 0 [Note] Event Scheduler: Loaded 0 events
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:28.524336Z 0 [Note] mysqld: ready for connections.
lampstack_db.1.wgofhqdl1v33#moby | Version: '5.7.18' socket: '/var/run/mysqld/mysqld.sock' port: 3306 MySQL Community Server (GPL)
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:28.524369Z 0 [Note] Executing 'SELECT * FROM INFORMATION_SCHEMA.TABLES;' to get a list of tables using the deprecated partition engine. You may use the startup option '--disable-partition-engine-check' to skip this check.
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:28.524372Z 0 [Note] Beginning of list of non-natively partitioned tables
lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:28.641848Z 0 [Note] End of list of non-natively partitioned tables
I had the same issue running linux containers on a windows machine when I created the secret inline.
echo mypassword | docker secret create mysql_db_root -
The actual password gets saved with a space, carriage return, and new line at the end. This can be seen if you look at the bytes in the file. In the running mysql container you can use the od command like the following example below to view the bytes. Or outside the container you can dump the /run/secrets/mysql_db_root content to a file and view with your favorite hex editor on windows to see the added bytes.
od -xa /run/secrets/mysql_db_root
To resolve the issue create the secret by putting it in a file and then using the file to generate the docker secret. See the mysql github issue for more details.
docker secret create mysql_db_root mypasswordfile.txt