Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pod creation fails inspite of MYSQL_ROOT_PASSWORD being present #174

Open
dpkshetty opened this issue May 18, 2022 · 3 comments
Open

Pod creation fails inspite of MYSQL_ROOT_PASSWORD being present #174

dpkshetty opened this issue May 18, 2022 · 3 comments

Comments

@dpkshetty
Copy link

I am trying to create a mariadb Pod that will have a db and tables pre-created.
In order to achive that, I am using a Dockerfile as below

FROM registry.redhat.io/rhel8/mariadb-105

# needed for intialization
ENV MYSQL_ROOT_PASSWORD=root
ENV MYSQL_DATABASE=qod

COPY 1_createdb.sql /tmp/
COPY 2_authors.sql /tmp/
COPY 3_genres.sql /tmp/
COPY 4_quotes_sm.sql /tmp/

COPY run.sh /usr/share/container-scripts/mysql/init/

CMD ["run-mysqld"]

My github repo is:
https://github.com/dpkshetty/qod-db/tree/v2

Inspite of MYSQL_ROOT_PASSWORD defined in the Dockerfile, the Pod fails to run and errors out with the below msg...

=> sourcing 20-validate-variables.sh ...
You must either specify the following environment variables:
  MYSQL_USER (regex: '^[a-zA-Z0-9_]+$')
  MYSQL_PASSWORD (regex: '^[a-zA-Z0-9_~!@#$%^&*()-=<>,.?;:|]+$')
  MYSQL_DATABASE (regex: '^[a-zA-Z0-9_]+$')
Or the following environment variable:
  MYSQL_ROOT_PASSWORD (regex: '^[a-zA-Z0-9_~!@#$%^&*()-=<>,.?;:|]+$')
Or both.
Optional Settings:
  MYSQL_LOWER_CASE_TABLE_NAMES (default: 0)
  MYSQL_LOG_QUERIES_ENABLED (default: 0)
  MYSQL_MAX_CONNECTIONS (default: 151)
  MYSQL_FT_MIN_WORD_LEN (default: 4)
  MYSQL_FT_MAX_WORD_LEN (default: 20)
  MYSQL_AIO (default: 1)
  MYSQL_KEY_BUFFER_SIZE (default: 32M or 10% of available memory)
  MYSQL_MAX_ALLOWED_PACKET (default: 200M)
  MYSQL_TABLE_OPEN_CACHE (default: 400)
  MYSQL_SORT_BUFFER_SIZE (default: 256K)
  MYSQL_READ_BUFFER_SIZE (default: 8M or 5% of available memory)
  MYSQL_INNODB_BUFFER_POOL_SIZE (default: 32M or 50% of available memory)
  MYSQL_INNODB_LOG_FILE_SIZE (default: 8M or 15% of available memory)
  MYSQL_INNODB_LOG_BUFFER_SIZE (default: 8M or 15% of available memory)

For more information, see https://github.com/sclorg/mariadb-container
@dpkshetty
Copy link
Author

I even tried by specifying the env var at the time of deployment, but it still fails with the same error

image

@dpkshetty
Copy link
Author

Even tried creating a secret with MYSQL_ROOT_PASSWORD and injecting it into the workload and it fails!

@rydevops
Copy link

rydevops commented Jul 20, 2023

Hi @dpkshetty. The MYSQL_ROOT_PASSWORD is mutually exclusive from MYSQL_DB. You have to use one or the other. If you are using MYSQL_DB, you also need to include MYSQL_USER and MYSQL_PASSWORD.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants