Mariadb – Cannot connect to MariaDB Columnstore database on Docker

mariadb

I'm running MariaDB 10.5 Columnstore on Docker as described here. This works fine when I connect to the database starting a command line in the container itself.

But when I try to connect with an SQL Client (such as DBeaver) from localhost on port 3306, I get the following error:

Host '_gateway' is not allowed to connect to this MariaDB server

I tried to fix that changing the /etc/my.sql.d/server.cnf file setting:

[mysqld]
bind-address = 0.0.0.0

but the container always fails after restart.

How to make a MariaDB Columnstore container accept connections from localhost and/or other IP addresses?

Best Answer

There's no need to change the config file as bind-address is commented out.

The issue is that you need a user to be authorized to a host that's not localhost, root is authorized to localhost only. Creating a new user from inside the container solved the problem.

mysql -u root -p
CREATE USER 'user1'@'%' IDENTIFIED BY 'xxxxxxx';
GRANT ALL PRIVILEGES ON *.* TO 'user1'@'%' WITH GRANT OPTION;