Docker-compose: Database is uninitialized

docker-compose postgres database is uninitialized and superuser password is not specified
docker mysql
docker-compose mysql
docker database
mysql_allow_empty_password docker
bitbucket pipeline database is uninitialized and superuser password is not specified
mariadb docker-compose
docker-mysql client

I have a problem with docker-compose and mysql:

docker-compose.yml

version: '2' 
  services:
   db:
    image: mysql
    volumes:
      - "./sito/db/:/var/lib/mysql"
    ports:
      - "3306:3306"
    restart: always
    environment:
      MYSQL_ROOT_PASSWORD:

   app:
    depends_on:
      - db
    image: eboraas/apache-php
    links:
      - db
    ports:
      - "80:80"
    volumes:
      - ./sito/:/var/www/html/

An error occurred when I compose this container:

Recreating phpapp_phpapache_1
Attaching to phpapp_db_1, phpapp_phpapache_1
db_1 | error: database is uninitialized and password option is not specified 
db_1 | You need to specify one of MYSQL_ROOT_PASSWORD, MYSQL_ALLOW_EMPTY_PASSWORD and MYSQL_RANDOM_ROOT_PASSWORD
phpapache_1 | AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.30.0.3. Set the 'ServerName' directive globally to suppress this message
phpapp_db_1 exited with code 1
db_1 | error: database is uninitialized and password option is not specified 
db_1 | You need to specify one of MYSQL_ROOT_PASSWORD, MYSQL_ALLOW_EMPTY_PASSWORD and MYSQL_RANDOM_ROOT_PASSWORD
db_1 | error: database is uninitialized and password option is not specified 
db_1 | You need to specify one of MYSQL_ROOT_PASSWORD, MYSQL_ALLOW_EMPTY_PASSWORD and MYSQL_RANDOM_ROOT_PASSWORD
db_1 | error: database is uninitialized and password option is not specified 
db_1 | You need to specify one of MYSQL_ROOT_PASSWORD, MYSQL_ALLOW_EMPTY_PASSWORD and MYSQL_RANDOM_ROOT_PASSWORD
db_1 | error: database is uninitialized and password option is not specified

But the database don't have a password. How can I solve it?

According the documentation, instead of MYSQL_ROOT_PASSWORD: you have to use - and = and also you should use a 'password' The result it will be:

- MYSQL_ROOT_PASSWORD=some_password

In your example:

version: '2' 
  services:
   db:
    image: mysql
    volumes:
      - "./sito/db/:/var/lib/mysql"
    ports:
      - "3306:3306"
    restart: always
    environment:
      - MYSQL_ROOT_PASSWORD=some_password

[ERROR] [Entrypoint]: Database is uninitialized and password option , Hi Guys, I am trying to launch one mysql container in docker, but It [ERROR] [ Entrypoint]: Database is uninitialized and password option is not specified How do I go from development docker-compose.yml to deployed� Docker-compose: Database is uninitialized. Ask Question Asked 3 years, 9 months ago. Active 2 months ago. Viewed 22k times 16. 1. I have a problem with docker-compose

error: database is uninitialized and password option is not specified , FrenchBen commented on Dec 12, 2016. This is expected - Please see the docs for Mysql: https://hub.docker. Waiting for local database serverCouldn't connect to database container. Database server may not be started. Alternatively, you may see the following in log output. Error: Database is uninitialized and superuser password is not specified. You must specify POSTGRES_PASSWORD for the superuser. Use

It looks like you're setting the MYSQL_ROOT_PASSWORD to nothing. Per the documentation, it is required.

https://hub.docker.com/_/mysql/

MYSQL_ROOT_PASSWORD

This variable is mandatory and specifies the password that will be set for the MySQL root superuser account.

database is uninitialized and password option is not specified � Issue , Try adding MYSQL_ROOT_PASSWORD: docker to the DB environment, and rebuilding? 2. Some people have recently come across an error with the circleci/postgres image that looks something like this:. Error: Database is uninitialized and superuser

I just wanted to point out something, if using docker run command in terminal and not docker-compose, this would be the command:

docker run -e MYSQL_ROOT_PASSWORD=password mysql_image

Just notice that it won't work if you put -e MYSQL_ROOT_PASSWORD=password after mysql_image

Docker Compose : Setting up web development stack step by step , Edit the docker-compose.yml to add mysql configuration… [ERROR] [ Entrypoint]: Database is uninitialized and password option is not� ERROR 2: Unable to set mem_limit with docker-compose version 3.x. Solved Problem: version ‘2’ support mem_limit. Docker version “3” support memory limit as below. Version 3: deploy: resources: limits: memory: 512M ERROR 3: docker database is uninitialized and password option is not specified

we can use

docker container run -d --name mysql -e MYSQL_RANDOM_ROOT_PASSWORD=password mysql

you can give any name and any password

Database is uninitialized and superuser password , Update your docker-compose.yml or corresponding configuration with the POSTGRES_HOST_AUTH_METHOD environment variable to revert� MySQL is a widely used, open-source relational database management system (RDBMS).

Use Docker to run a MySQL Database Server for Development , Use Docker to run a MySQL Database Server for Development so it is often better to compose multiple single use containers rather than place all your error: database is uninitialized and password option is not specified $ docker-compose logs Attaching to sample_db_1 db_1 | Error: Database is uninitialized and superuser password is not specified. db_1 | You must specify POSTGRES_PASSWORD to a non-empty value for the db_1 | superuser.

Database is uninitialized and superuser password is not , I don't want to do "docker run POSTGRES_PASSWORD="pass"", because I am using docker-compose run --build. Also how come the database is not initialized � MYSQL_ROOT_PASSWORD=pass1 MYSQL_DATABASE=db1 MYSQL_USER=user1 MYSQL_PASSWORD=pass2 This is the result of run the command docker-compose up: > docker-compose up WARNING: The MYSQL_ROOT_PASSWORD variable is not set. Defaulting to a blank string. WARNING: The MYSQL_PASSWORD variable is not set. Defaulting to a blank string.

MySQL Docker Containers: Understanding the Basics, 3. Status: Downloaded newer image for mysql:latest. error: database is uninitialized and password option is not specified. You need to specify� [root@vm1 ~]# docker run -it --name mysql mysql:latest 2020-04-14 04:55:17+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.19-1debian10 started. 2020-04-14 04:55:18+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql' 2020-04-14 04:55:18+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.19-1debian10

Comments
  • Possible duplicate of docker, MYSQL_ROOT_PASSWORD do not work
  • Hi Mostafa, I couldn't access the generated password using `docker logs <container-id>, how can I access the password?
  • great... and how do you do that? docker run -e MYSQL_ROOT_PASSWORD=root doesn't work
  • It does work. Look at the official documentation. If you run printenv in your container you should see the env variables set. hub.docker.com/_/mysql