Skip to content

SQLSTATE 42000 Syntax Error 1231 Variable 'sql_mode' can't be set to value 'NO_AUTO_CREATE_USER' in drupal 8 container #131

@themanfrommsu

Description

@themanfrommsu

downloaded newest drupal image with the command:
docker pull drupal

Set up container (linking to existing MySQL container):
docker run --name mydrupal --link mysql80:mysql -p 8080:80 -d drupal

Received following error when connected to docker container via web browser and at point where typing in dbusername/dbpassword/dbname:
SQLSTATE[42000]: Syntax error or access violation: 1231 Variable 'sql_mode' can't be set to the value of 'NO_AUTO_CREATE_USER'

Was able to fix the problem by performing the following edits in the drupal container:

  1. core/lib/Drupal/Core/Database/Driver/mysql/Connection.php (183): Remove NO_AUTO_CREATE_USER
  2. core/lib/Drupal/Core/Database/Schema.php (202): change "table_name" to "TABLE_NAME as table_name"

Found the fix at the following website:
https://www.drupal.org/project/drupal/issues/2966523

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