docker icon indicating copy to clipboard operation
docker copied to clipboard

Fixing missing MySQL password

Open natsu90 opened this issue 4 years ago • 1 comments

getting below error when running docker-compose from .examples/nginx/

nginx_db_1 exited with code 1
db_1   | 2021-08-12 10:43:46+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
db_1   | 2021-08-12 10:43:46+00:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:10.6.4+maria~focal started.
db_1   | 2021-08-12 10:43:46+00:00 [ERROR] [Entrypoint]: Database is uninitialized and password option is not specified
db_1   | 	You need to specify one of MARIADB_ROOT_PASSWORD, MARIADB_ALLOW_EMPTY_ROOT_PASSWORD and MARIADB_RANDOM_ROOT_PASSWORD

natsu90 avatar Aug 12 '21 11:08 natsu90

Please consider also to set a password for the matomo user in the db.env file (i.e. MYSQL_PASSWORD=matomo), otherwise with an empty password the user won't be created.

alebertacco avatar Sep 24 '21 15:09 alebertacco

The password is not set on purpose in the example. You must generate a local secret. IMHO MYSQL_RANDOM_ROOT_PASSWORD is a bad default, it may leave you in trouble if you want to access, backup or restore the database in the future.

J0WI avatar Nov 14 '23 22:11 J0WI