Skip to content

skip-name-resolve hard coded in my.cnf #154

@angelcervera

Description

@angelcervera

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 ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions