Skip to content

Image ftgo-application-mysql init sql error #181

@tianzhen45

Description

@tianzhen45

In container ftgo-application-mysql
/docker-entrypoint-initdb.d/0.configure-root-user.sh

#! /bin/bash

if [ -z "$MYSQL_ROOT_HOST" ] ; then
  MYSQL_ROOT_HOST=%
  echo defaulting MYSQL_ROOT_HOST=$MYSQL_ROOT_HOST
fi

cat >> /docker-entrypoint-initdb.d/5.configure-users.sql <<END
CREATE USER 'root'@'${MYSQL_ROOT_HOST}' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}';
GRANT ALL ON *.* TO 'root'@'${MYSQL_ROOT_HOST}' WITH GRANT OPTION ;
GRANT PROXY ON ''@'' TO 'root'@'${MYSQL_ROOT_HOST}' WITH GRANT OPTION ;"
END
...

GRANT PROXY ON ''@'' TO 'root'@'${MYSQL_ROOT_HOST}' WITH GRANT OPTION ;"

The line has an extra double quotation .

There is log error.

2024-01-03 16:37:13 mysql-1          | [Entrypoint] running /docker-entrypoint-initdb.d/5.configure-users.sql
2024-01-03 16:37:13 mysql-1          | ERROR 1064 (42000) at line 3: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '"' at line 1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions