MariaDB 10.3 Image refuses remote connections

Hello everyone,
I tried Maria DB a while ago (1 year or so) and i had no problems with it. Today I tried it again but can’t manage to remote connect to database from any sql clients(terminal or DataGrip) from my host.

So more info:


  • OS: macOS
  • Docker version: Version 18.03.0-ce-mac60 (23751)
  • Using docker-compose up -d command

What did I tried:

  • changing cnf file to deactivate bind line, to activate it and to change it to
  • being sure that the user created in compose file exists and have remote access priv

What error i get:
when i use mysql --host= --port=8000 -u ****** -p on host’s terminal I get ERROR 2003 (HY000): Can't connect to MySQL server on '' (61)
But when I try to connect to db from container is working.
custom cnf file correctly loaded in container:

default-character-set = utf8
bind-address =
character-set-server  = utf8
collation-server      = utf8_general_ci
character_set_server   = utf8
collation_server       = utf8_general_ci

yaml file:

 version: '3'
    image: "rabbitmq:3-management"
    restart: always
      - "8080:15672"
      - "5672:5672"
      - "5671:5671"
      NAME: 'rabbitmq1'
      - ./MountPoints/Data/RabbitMQ:/var/lib/rabbitmq/mnesia/
    image: "mariadb:10.3"
    restart: always
      - "3306:8000"
      MYSQL_ROOT_PASSWORD: "******"
      MYSQL_USER: "******"
      MYSQL_PASSWORD: "******"
      MYSQL_DATABASE: "******"
      - ./MountPoints/Data/projDB:/var/lib/mysql
      - ./MountPoints/Configs/SQL:/etc/mysql/conf.d/

Thank you for any ideas

This is definitely wrong. If you’re running a server process in a Docker container, and it’s set to only listen on (or IPv6 ::1), nothing outside the container will ever be able to talk to it. (or :: ) is pretty much always right.

and still it did not work even with nor *

This tells Docker, when the host receives an inbound connection on port 3306, to send it to port 8000 in the container. But probably the database server is listening on port 3306 in the container and nothing is listening on port 8000. Try "3306:3306" instead here.

oh wow i did not saw that one … i inverted the mapping …