4

I'm attempting to use Portainer's default Wordpress template to build a little wordpress stack, on a Synology NAS. It outright declares MYSQL_DATABASE_PASSWORD, but on run, I get the following:

You need to specify one of MYSQL_ROOT_PASSWORD, MYSQL_ALLOW_EMPTY_PASSWORD and MYSQL_RANDOM_ROOT_PASSWORD

I've tried the same for FileRun using their default docker-compose.yml file in their documentation, and even that throws the above error.

I've tried exporting any/all of those environment variables, but have found the same issue occurs.

version: '2'

services:
  db:
    image: mariadb:10.1
    environment:
      MYSQL_ROOT_PASSWORD: your_mysql_root_password
      MYSQL_USER: your_filerun_username
      MYSQL_PASSWORD: your_filerun_password
      MYSQL_DATABASE: your_filerun_database
    volumes:
      - /filerun/db:/var/lib/mysql

  web:
    image: afian/filerun
    environment:
      FR_DB_HOST: db
      FR_DB_PORT: 3306
      FR_DB_NAME: your_filerun_database
      FR_DB_USER: your_filerun_username
      FR_DB_PASS: your_filerun_password
      APACHE_RUN_USER: www-data
      APACHE_RUN_USER_ID: 33
      APACHE_RUN_GROUP: www-data
      APACHE_RUN_GROUP_ID: 33
    depends_on:
      - db
    links:
      - db:db
    ports:
      - "80:80"
    volumes:
      - /filerun/html:/var/www/html
      - /filerun/user-files:/user-files

Expected results would be the stack runs, specifically the mariadb container. What actually happens is the container dies, repeatedly, throwing the You need to specify one of MYSQL_ROOT_PASSWORD, MYSQL_ALLOW_EMPTY_PASSWORD and MYSQL_RANDOM_ROOT_PASSWORD error.

3
  • I am unable to reproduce this error with your docker-compose.yml file. Are you sure the error is coming from the db container? Have you tried pulling the latest version of mariadb:10.1? Commented May 22, 2019 at 0:02
  • I just tried using the filerun docker-compose, but with the latest version of mariadb. Same thing happened with that as well, with the db container dying repeatedly. Commented May 22, 2019 at 4:36
  • please add the command you use to start the containers and the complete output with the error. This setup works so it might be something about how you run it. Also can you post the result of docker-compose config? Commented May 22, 2019 at 7:23

2 Answers 2

2

As their doc says there is no variable with the name MYSQL_DATABASE_PASSWORD. these are available ones: "Currently, this is only supported for MYSQL_ROOT_PASSWORD, MYSQL_ROOT_HOST, MYSQL_DATABASE, MYSQL_USER, and MYSQL_PASSWORD."

Or maybe I didn't get your issue.

Sign up to request clarification or add additional context in comments.

Comments

1

Came across this question via Google. I was having this issue when seeding a database per this answer.

In the docs that @Siyavash mentions (under "Environment Variables"):

Do note that none of the variables below will have any effect if you start the container with a data directory that already contains a database: any pre-existing database will always be left untouched on container startup.

So the user variables I was using would need be placed in the Dockerfile, and not docker-compose.yml.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.