Skip to content

MariaDB: Access denied for user 'test'@'%' to database. #932

@maistrovyi

Description

@maistrovyi

org.testcontainers.mariadb version: 1.9.1
jdbc-url property:
url: "jdbc:tc:mariadb:latest://localhost:3306/test?TC_INITFUNCTION=packagepath.TestContainersDatabaseDescriptor::createDatabase"
And TestContainersDatabaseDescriptor class

public class TestContainersDatabaseDescriptor {

    @Language(value = "MariaDB")
    private static final String CREATE_DATABASE = "CREATE DATABASE dictionaries CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci";

    public static void createDatabase(Connection connection) throws SQLException {
        connection.createStatement().execute(CREATE_DATABASE);
    }

}

As the result:
Caused by: java.sql.SQLException: Access denied for user 'test'@'%' to database 'dictionaries'

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions