-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Closed
Description
I am trying to use the image in a docker compose, executing the following script from /docker-entrypoint-initdb.d :
-- If not exist, create the database.
CREATE DATABASE IF NOT EXISTS sonar CHARACTER SET utf8 COLLATE utf8_general_ci;
-- Create the user and password and grant permission to access from sonar.
CREATE USER sonarUsr@localhost IDENTIFIED BY 'password';
CREATE USER sonarUsr@sonar IDENTIFIED BY 'password';
GRANT ALL ON sonar.* TO sonarUsr@localhost;
GRANT ALL ON sonar.* TO sonarUsr@sonar;
But the Dockerfile adds the skip-name-resolve parameter in the config file. Dockerfile, line 37:
RUN sed -Ei 's/^(bind-address|log)/#&/' /etc/mysql/my.cnf \
&& echo 'skip-host-cache\nskip-name-resolve' | awk '{ print } $1 == "[mysqld]" && c == 0 { c = 1; system("cat") }' /etc/mysql/my.cnf > /tmp/my.cnf \
&& mv /tmp/my.cnf /etc/mysql/my.cnf
So, myslq can not translate the name into an IP, so it does not create the user.
Why is "skip-name-resolve" hard coded ?
hablutzel1
Metadata
Metadata
Assignees
Labels
No labels