Teamspeak3 Docker connection

Hello,
I installed teamspeak on docker and want to make it with mariadb connection.
I have already installed mariadb on local without docker,
so i use only teamspeak docker without mariadb docker

When i start server i have this info:

Could not connect to mariadb server: Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’ (2)

my env:

      TS3SERVER_DB_PLUGIN: ts3db_mariadb
      TS3SERVER_DB_SQLCREATEPATH: create_mariadb
      TS3SERVER_DB_HOST: localhost
      TS3SERVER_DB_USER: ts3serv
      TS3SERVER_DB_PASSWORD: example
      TS3SERVER_DB_NAME: ts3serv
      TS3SERVER_DB_WAITUNTILREADY: 30
      TS3SERVER_LICENSE: accept
      TS3SERVER_DB_PORT: 3306

command “mysql -h localhost” works fine

I’m not a Docker pro and my answer could be wrong:

In General Docker is a split network from the machine where it is running on.
So It’s localhost (if localhost does exist there at all) is not the same you have on your machine where Docker is running on.

You must make sure that the Server which runs in Docker can connect to the Machine where the MariaDB server is running on.

5 Likes