docker
docker copied to clipboard
Fixing missing MySQL password
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
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.
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.