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
Related
I have been trying to get mariadb to work with named volumes, but I keep running into the problem that it cannot write to it.
My docker host
Docker Version: 20.10.3 on Synology DSM 7
My docker-compose.yml
---
version: "3.8"
services:
bitwarden:
depends_on:
- database
env_file:
- /volume1/docker/bitwardenextvol/settings.env
image: bitwarden/self-host:beta
restart: unless-stopped
ports:
- "4088:4080"
- "4449:4443"
volumes:
- bitwarden:/etc/bitwarden
database:
environment:
MARIADB_USER: "bitwarden"
MARIADB_PASSWORD: "****************"
MARIADB_DATABASE: "bitwarden_vault"
MARIADB_RANDOM_ROOT_PASSWORD: "true"
image: mariadb:latest
user: 1026:100
restart: unless-stopped
volumes:
- data:/var/lib/mysql
volumes:
bitwarden:
external: true
data:
external: true
My named volumes
[
{
"CreatedAt": "2023-01-14T18:32:39+01:00",
"Driver": "local",
"Labels": null,
"Mountpoint": "/volume1/#docker/volumes/bitwarden/_data",
"Name": "bitwarden",
"Options": {
"device": "//diskstation.diesveld.lan/docker/bitwardenextvol/bitwarden",
"o": "addr=diskstation.diesveld.lan,username=harald,password=********,vers=3.0",
"type": "cifs"
},
"Scope": "local"
}
]
[
{
"CreatedAt": "2023-01-14T18:33:24+01:00",
"Driver": "local",
"Labels": null,
"Mountpoint": "/volume1/#docker/volumes/data/_data",
"Name": "data",
"Options": {
"device": "//diskstation.diesveld.lan/docker/bitwardenextvol/data",
"o": "addr=diskstation.diesveld.lan,username=harald,password=********,vers=3.0",
"type": "cifs"
},
"Scope": "local"
}
]
The host directory
harald#diskstation:/volume1/docker$ ls -al | grep bitwardenextvol
drwxrwxrwx+ 1 harald users 116 Jan 14 18:36 bitwardenextvol
Inside the host directory
harald#diskstation:/volume1/docker/bitwardenextvol$ ls -al
total 16
drwxrwxrwx+ 1 harald users 116 Jan 14 18:36 .
drwxrwxrwx+ 1 root root 294 Jan 14 18:41 ..
drwxrwxrwx+ 1 harald users 94 Jan 14 18:39 bitwarden
drwxrwxrwx+ 1 harald users 30 Jan 14 18:37 data
-rwxrwxrwx+ 1 harald users 698 Jan 14 22:07 docker-compose.yml
-rwxrwxrwx+ 1 harald users 6148 Jan 14 18:11 .DS_Store
drwxrwxrwx+ 1 root users 94 Jan 14 18:12 #eaDir
-rwxrwxrwx+ 1 harald users 1940 Jan 14 18:18 settings.env
My user account
harald#diskstation:/volume1/docker/bitwardenextvol$ id harald
uid=1026(harald) gid=100(users) groups=100(users),101(administrators)
The error message that I get when running sudo docker-compose up
harald#diskstation:/volume1/docker/bitwardenextvol$ sudo docker-compose up
Creating bitwardenextvol_database_1 ... done
Creating bitwardenextvol_bitwarden_1 ... done
Attaching to bitwardenextvol_database_1, bitwardenextvol_bitwarden_1
database_1 | 2023-01-14 23:24:33+00:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:10.10.2+maria~ubu2204 started.
bitwarden_1 | addgroup: gid '100' in use
database_1 | 2023-01-14 23:24:33+00:00 [Note] [Entrypoint]: Initializing database files
database_1 | 2023-01-14 23:24:33 0 [Warning] Can't create test file /var/lib/mysql/a68bd83e89af.lower-test
database_1 | 2023-01-14 23:24:33 0 [ERROR] mariadbd: Can't create/write to file './ddl_recovery.log' (Errcode: 13 "Permission denied")
database_1 | 2023-01-14 23:24:33 0 [ERROR] DDL_LOG: Failed to create ddl log file: ./ddl_recovery.log
database_1 | 2023-01-14 23:24:33 0 [ERROR] Aborting
database_1 |
database_1 | Installation of system tables failed! Examine the logs in
database_1 | /var/lib/mysql/ for more information.
database_1 |
database_1 | The problem could be conflicting information in an external
database_1 | my.cnf files. You can ignore these by doing:
database_1 |
database_1 | shell> /usr/bin/mariadb-install-db --defaults-file=~/.my.cnf
database_1 |
database_1 | You can also try to start the mysqld daemon with:
database_1 |
database_1 | shell> /usr/sbin/mariadbd --skip-grant-tables --general-log &
database_1 |
database_1 | and use the command line tool /usr/bin/mariadb
database_1 | to connect to the mysql database and look at the grant tables:
database_1 |
database_1 | shell> /usr/bin/mysql -u root mysql
database_1 | mysql> show tables;
database_1 |
database_1 | Try 'mysqld --help' if you have problems with paths. Using
database_1 | --general-log gives you a log in /var/lib/mysql/ that may be helpful.
database_1 |
database_1 | The latest information about mysql_install_db is available at
database_1 | ******/kb/en/installing-system-tables-mysql_install_db
database_1 | You can find the latest source at ******** and
database_1 | the maria-discuss email list at ********/~maria-discuss
database_1 |
database_1 | Please check all of the above before submitting a bug report
database_1 | at *******/jira
database_1 |
bitwardenextvol_database_1 exited with code 1
database_1 | 2023-01-14 23:24:35+00:00 [Note] [Entrypoint]: Initializing database files
bitwarden_1 | 2023-01-14 23:24:35,560 INFO Included extra file "/etc/supervisor.d/admin.ini" during parsing
bitwarden_1 | 2023-01-14 23:24:35,560 INFO Included extra file "/etc/supervisor.d/api.ini" during parsing
bitwarden_1 | 2023-01-14 23:24:35,560 INFO Included extra file "/etc/supervisor.d/events.ini" during parsing
bitwarden_1 | 2023-01-14 23:24:35,560 INFO Included extra file "/etc/supervisor.d/icons.ini" during parsing
bitwarden_1 | 2023-01-14 23:24:35,560 INFO Included extra file "/etc/supervisor.d/identity.ini" during parsing
bitwarden_1 | 2023-01-14 23:24:35,560 INFO Included extra file "/etc/supervisor.d/nginx.ini" during parsing
bitwarden_1 | 2023-01-14 23:24:35,560 INFO Included extra file "/etc/supervisor.d/notifications.ini" during parsing
bitwarden_1 | 2023-01-14 23:24:35,560 INFO Included extra file "/etc/supervisor.d/scim.ini" during parsing
bitwarden_1 | 2023-01-14 23:24:35,561 INFO Included extra file "/etc/supervisor.d/sso.ini" during parsing
database_1 | 2023-01-14 23:24:35 0 [Warning] Can't create test file /var/lib/mysql/a68bd83e89af.lower-test
bitwarden_1 | 2023-01-14 23:24:35,571 INFO RPC interface 'supervisor' initialized
bitwarden_1 | 2023-01-14 23:24:35,571 CRIT Server 'unix_http_server' running without any HTTP authentication checking
bitwarden_1 | 2023-01-14 23:24:35,572 INFO supervisord started with pid 48
database_1 | 2023-01-14 23:24:35 0 [ERROR] mariadbd: Can't create/write to file './ddl_recovery.log' (Errcode: 13 "Permission denied")
database_1 | 2023-01-14 23:24:35 0 [ERROR] DDL_LOG: Failed to create ddl log file: ./ddl_recovery.log
database_1 | 2023-01-14 23:24:35 0 [ERROR] Aborting
database_1 |
database_1 | Installation of system tables failed! Examine the logs in
database_1 | /var/lib/mysql/ for more information.
database_1 |
database_1 | The problem could be conflicting information in an external
database_1 | my.cnf files. You can ignore these by doing:
database_1 |
database_1 | shell> /usr/bin/mariadb-install-db --defaults-file=~/.my.cnf
database_1 |
database_1 | You can also try to start the mysqld daemon with:
database_1 |
database_1 | shell> /usr/sbin/mariadbd --skip-grant-tables --general-log &
database_1 |
database_1 | and use the command line tool /usr/bin/mariadb
database_1 | to connect to the mysql database and look at the grant tables:
database_1 |
database_1 | shell> /usr/bin/mysql -u root mysql
database_1 | mysql> show tables;
database_1 |
database_1 | Try 'mysqld --help' if you have problems with paths. Using
database_1 | --general-log gives you a log in /var/lib/mysql/ that may be helpful.
database_1 |
database_1 | The latest information about mysql_install_db is available at
database_1 | ********/kb/en/installing-system-tables-mysql_install_db
database_1 | You can find the latest source at https://downloads.mariadb.org and
database_1 | the maria-discuss email list at https://launchpad.net/~maria-discuss
database_1 |
database_1 | Please check all of the above before submitting a bug report
database_1 | at ******
database_1 |
bitwarden_1 | 2023-01-14 23:24:36,574 INFO spawned: 'identity' with pid 49
bitwarden_1 | 2023-01-14 23:24:36,576 INFO spawned: 'admin' with pid 50
bitwarden_1 | 2023-01-14 23:24:36,578 INFO spawned: 'api' with pid 51
bitwarden_1 | 2023-01-14 23:24:36,579 INFO spawned: 'icons' with pid 52
bitwarden_1 | 2023-01-14 23:24:36,583 INFO spawned: 'nginx' with pid 53
bitwarden_1 | 2023-01-14 23:24:36,586 INFO spawned: 'notifications' with pid 54
database_1 | 2023-01-14 23:24:36+00:00 [Note] [Entrypoint]: Initializing database files
database_1 | 2023-01-14 23:24:36 0 [Warning] Can't create test file /var/lib/mysql/a68bd83e89af.lower-test
database_1 | 2023-01-14 23:24:36 0 [ERROR] mariadbd: Can't create/write to file './ddl_recovery.log' (Errcode: 13 "Permission denied")
database_1 | 2023-01-14 23:24:36 0 [ERROR] DDL_LOG: Failed to create ddl log file: ./ddl_recovery.log
database_1 | 2023-01-14 23:24:36 0 [ERROR] Aborting
database_1 |
database_1 | Installation of system tables failed! Examine the logs in
database_1 | /var/lib/mysql/ for more information.
database_1 |
database_1 | The problem could be conflicting information in an external
database_1 | my.cnf files. You can ignore these by doing:
database_1 |
database_1 | shell> /usr/bin/mariadb-install-db --defaults-file=~/.my.cnf
database_1 |
database_1 | You can also try to start the mysqld daemon with:
database_1 |
database_1 | shell> /usr/sbin/mariadbd --skip-grant-tables --general-log &
database_1 |
database_1 | and use the command line tool /usr/bin/mariadb
database_1 | to connect to the mysql database and look at the grant tables:
database_1 |
database_1 | shell> /usr/bin/mysql -u root mysql
database_1 | mysql> show tables;
database_1 |
database_1 | Try 'mysqld --help' if you have problems with paths. Using
database_1 | --general-log gives you a log in /var/lib/mysql/ that may be helpful.
database_1 |
database_1 | The latest information about mysql_install_db is available at
database_1 | *******/kb/en/installing-system-tables-mysql_install_db
database_1 | You can find the latest source at ****** and
database_1 | the maria-discuss email list at *******/~maria-discuss
database_1 |
database_1 | Please check all of the above before submitting a bug report
database_1 | at ******
database_1 |
bitwardenextvol_database_1 exited with code 1
The weird thing is it works perfectly well with bind mounts to the very same location on disk. Also, the bitwarden container is working perfectly fine with the described named volume, however, the mariadb container is throwing the errors like in above log
[ERROR] mariadbd: Can't create/write to file './ddl_recovery.log' (Errcode: 13 "Permission denied")
The directory that the named volume is pointing to is not getting written in at all.
I cannot view the MariaDB logs, as the container keeps restarting so I cannot SSH into it.
What I get from the official documentation is that MariaDB should work perfectly fine with named volumes, but for some reason it is not in my case. My hunch was that it has to do with permissions. I tried adding the --user 1026:100 in the MariaDB service declaration but that doesn't change things.
I know I could simply work with bind mounts, but I really want to figure out how to do it with named volumes.
Who has some tips or knows how to further debug this? Your help or insights are much appreciated.
Updates based on answers
I noticed something peculiar though, the user mysql is not 999:999, but rather 66:66
harald#diskstation:~$ id mysql uid=66(mysql) gid=66(mysql) groups=66(mysql)
As I am a bit out of my comfort zone here, I cannot exactly estimate the impact of this.
As I can see in the below output, this user is not running any processes
harald#diskstation:~$ ps -u mysql
PID TTY TIME CMD
But when I try to delete the user (Synology does not support deluser) I cannot get it done:
harald#diskstation:~$ sudo synouser --del mysql
Lastest SynoErr=[user_db_delete.c:38] synouser.c:798 SYNOLocalAccountUserDelete failed. synoerr=[0xB800].
Otherwise I could get MariaDB recreate the mysql user with the right creds perhaps.
Results from docker run command from answer of Dan shows that the named volume can be read:
harald#diskstation:~$ sudo docker run -v data:/var/lib/mysql --rm mariadb ls -laZ /var/lib/mysql
total 8
drwxr-xr-x 2 root root ? 0 Jan 15 14:57 .
drwxr-xr-x 1 root root ? 76 Dec 9 02:27 ..
-rwxr-xr-x 1 root root ? 6148 Jan 14 16:40 .DS_Store
-rwxr-xr-x 1 root root ? 0 Jan 15 14:57 just-to-show-this-file-in-the-volume.yml
mysql user is indeed 999:999 inside container, but it is 66:66 outside for some weird reason.
harald#diskstation:~$ sudo docker run --rm mariadb id mysql
uid=999(mysql) gid=999(mysql) groups=999(mysql)
Changing the mount options of CIFS to include cache=none appears to be
one solution. The other is adding --innodb_flush_method=fsync to the
mariadb container args.
Mounting volume with cache=none option and adding
innodb_flush_method: "fsync"
to the docker-compose.yml does not change the behaviour unfortunately.
This is the latest state, with above remarks taken into account and without the --user. Still the same results.
harald#diskstation:~$ sudo docker volume inspect data
[
{
"CreatedAt": "2023-01-15T16:42:40+01:00",
"Driver": "local",
"Labels": {},
"Mountpoint": "/volume1/#docker/volumes/data/_data",
"Name": "data",
"Options": {
"device": "//diskstation.diesveld.lan/docker/bitwardenextvol/data",
"o": "addr=diskstation.diesveld.lan,username=harald,password=***,vers=3.0,cache=none",
"type": "cifs"
},
"Scope": "local"
}
]
And this is my docker-compose.yml
---
version: "3.8"
services:
bitwarden:
depends_on:
- database
env_file:
- /volume1/docker/bitwardenextvol/settings.env
image: bitwarden/self-host:beta
restart: unless-stopped
ports:
- "4088:4080"
- "4449:4443"
volumes:
- bitwarden:/etc/bitwarden
database:
environment:
MARIADB_USER: "bitwarden"
MARIADB_PASSWORD: "***"
MARIADB_DATABASE: "bitwarden_vault"
MARIADB_RANDOM_ROOT_PASSWORD: "true"
innodb_flush_method: "fsync"
image: mariadb:latest
restart: unless-stopped
volumes:
- data:/var/lib/mysql
volumes:
bitwarden:
external: true
data:
external: true
The logs from this:
harald#diskstation:/volume1/docker/bitwardenextvol$ sudo docker-compose up
Creating bitwardenextvol_database_1 ... done
Creating bitwardenextvol_bitwarden_1 ... done
Attaching to bitwardenextvol_database_1, bitwardenextvol_bitwarden_1
database_1 | 2023-01-16 06:26:00+00:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:10.10.2+maria~ubu2204 started.
bitwarden_1 | addgroup: gid '100' in use
database_1 | 2023-01-16 06:26:00+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
database_1 | 2023-01-16 06:26:00+00:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:10.10.2+maria~ubu2204 started.
database_1 | 2023-01-16 06:26:00+00:00 [Note] [Entrypoint]: Initializing database files
database_1 | 2023-01-16 6:26:00 0 [Warning] Can't create test file /var/lib/mysql/4d6c9c2f7405.lower-test
database_1 | 2023-01-16 6:26:00 0 [ERROR] mariadbd: Can't create/write to file './ddl_recovery.log' (Errcode: 13 "Permission denied")
database_1 | 2023-01-16 6:26:00 0 [ERROR] DDL_LOG: Failed to create ddl log file: ./ddl_recovery.log
database_1 | 2023-01-16 6:26:00 0 [ERROR] Aborting
database_1 |
database_1 | Installation of system tables failed! Examine the logs in
database_1 | /var/lib/mysql/ for more information.
database_1 |
database_1 | The problem could be conflicting information in an external
database_1 | my.cnf files. You can ignore these by doing:
database_1 |
database_1 | shell> /usr/bin/mariadb-install-db --defaults-file=~/.my.cnf
database_1 |
database_1 | You can also try to start the mysqld daemon with:
database_1 |
database_1 | shell> /usr/sbin/mariadbd --skip-grant-tables --general-log &
database_1 |
database_1 | and use the command line tool /usr/bin/mariadb
database_1 | to connect to the mysql database and look at the grant tables:
database_1 |
database_1 | shell> /usr/bin/mysql -u root mysql
database_1 | mysql> show tables;
database_1 |
database_1 | Try 'mysqld --help' if you have problems with paths. Using
database_1 | --general-log gives you a log in /var/lib/mysql/ that may be helpful.
database_1 |
database_1 | The latest information about mysql_install_db is available at
database_1 | https://mariadb.com/kb/en/installing-system-tables-mysql_install_db
database_1 | You can find the latest source at https://downloads.mariadb.org and
database_1 | the maria-discuss email list at https://launchpad.net/~maria-discuss
database_1 |
database_1 | Please check all of the above before submitting a bug report
database_1 | at https://mariadb.org/jira
database_1 |
bitwardenextvol_database_1 exited with code 1
bitwarden_1 | 2023-01-16 06:26:02,303 INFO Included extra file "/etc/supervisor.d/admin.ini" during parsing
bitwarden_1 | 2023-01-16 06:26:02,303 INFO Included extra file "/etc/supervisor.d/api.ini" during parsing
bitwarden_1 | 2023-01-16 06:26:02,303 INFO Included extra file "/etc/supervisor.d/events.ini" during parsing
bitwarden_1 | 2023-01-16 06:26:02,303 INFO Included extra file "/etc/supervisor.d/icons.ini" during parsing
bitwarden_1 | 2023-01-16 06:26:02,303 INFO Included extra file "/etc/supervisor.d/identity.ini" during parsing
bitwarden_1 | 2023-01-16 06:26:02,303 INFO Included extra file "/etc/supervisor.d/nginx.ini" during parsing
bitwarden_1 | 2023-01-16 06:26:02,304 INFO Included extra file "/etc/supervisor.d/notifications.ini" during parsing
bitwarden_1 | 2023-01-16 06:26:02,304 INFO Included extra file "/etc/supervisor.d/scim.ini" during parsing
bitwarden_1 | 2023-01-16 06:26:02,304 INFO Included extra file "/etc/supervisor.d/sso.ini" during parsing
bitwarden_1 | 2023-01-16 06:26:02,314 INFO RPC interface 'supervisor' initialized
bitwarden_1 | 2023-01-16 06:26:02,314 CRIT Server 'unix_http_server' running without any HTTP authentication checking
bitwarden_1 | 2023-01-16 06:26:02,315 INFO supervisord started with pid 47
database_1 | 2023-01-16 06:26:02+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
database_1 | 2023-01-16 06:26:02+00:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:10.10.2+maria~ubu2204 started.
database_1 | 2023-01-16 06:26:02+00:00 [Note] [Entrypoint]: Initializing database files
database_1 | 2023-01-16 6:26:02 0 [Warning] Can't create test file /var/lib/mysql/4d6c9c2f7405.lower-test
database_1 | 2023-01-16 6:26:03 0 [ERROR] mariadbd: Can't create/write to file './ddl_recovery.log' (Errcode: 13 "Permission denied")
database_1 | 2023-01-16 6:26:03 0 [ERROR] DDL_LOG: Failed to create ddl log file: ./ddl_recovery.log
database_1 | 2023-01-16 6:26:03 0 [ERROR] Aborting
database_1 |
database_1 | Installation of system tables failed! Examine the logs in
database_1 | /var/lib/mysql/ for more information.
database_1 |
database_1 | The problem could be conflicting information in an external
database_1 | my.cnf files. You can ignore these by doing:
database_1 |
database_1 | shell> /usr/bin/mariadb-install-db --defaults-file=~/.my.cnf
database_1 |
database_1 | You can also try to start the mysqld daemon with:
database_1 |
database_1 | shell> /usr/sbin/mariadbd --skip-grant-tables --general-log &
database_1 |
database_1 | and use the command line tool /usr/bin/mariadb
database_1 | to connect to the mysql database and look at the grant tables:
database_1 |
database_1 | shell> /usr/bin/mysql -u root mysql
database_1 | mysql> show tables;
database_1 |
database_1 | Try 'mysqld --help' if you have problems with paths. Using
database_1 | --general-log gives you a log in /var/lib/mysql/ that may be helpful.
database_1 |
database_1 | The latest information about mysql_install_db is available at
database_1 | https://mariadb.com/kb/en/installing-system-tables-mysql_install_db
database_1 | You can find the latest source at https://downloads.mariadb.org and
database_1 | the maria-discuss email list at https://launchpad.net/~maria-discuss
database_1 |
database_1 | Please check all of the above before submitting a bug report
database_1 | at https://mariadb.org/jira
database_1 |
bitwarden_1 | 2023-01-16 06:26:03,318 INFO spawned: 'identity' with pid 48
bitwarden_1 | 2023-01-16 06:26:03,320 INFO spawned: 'admin' with pid 49
bitwarden_1 | 2023-01-16 06:26:03,322 INFO spawned: 'api' with pid 50
bitwarden_1 | 2023-01-16 06:26:03,324 INFO spawned: 'icons' with pid 51
bitwarden_1 | 2023-01-16 06:26:03,326 INFO spawned: 'nginx' with pid 52
bitwarden_1 | 2023-01-16 06:26:03,328 INFO spawned: 'notifications' with pid 53
Its either the UID mapping or a selinux label, (note the + in the ls -la output). With the selinux label its probably up to an selinux boolean to allow docker to access the volume. Specific selinux labels can also be applied at the mount time.
When checking uid mapping its helpful to look inside the container as the mappings may be different:
docker run -v data:/var/lib/mysql --rm mariadb ls -laZ /var/lib/mysql
Rather than putting user in compose you can get the CIFS to map the uid to the 999:999 user the mariadb container uses by default.
docker run --rm mariadb id mysql
uid=999(mysql) gid=999(mysql) groups=999(mysql)
Based of MDEV-26970, the conditions under which MariaDB under its default --innodb_flush_method=O_DIRECT work with CIFS is limited.
Changing the mount options of CIFS to include cache=none appears to be one solution.
The other is adding --innodb_flush_method=fsync to the mariadb container command.
command: --innodb_flush_method=fsync
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.
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 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'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