Closed christianvw closed 3 years ago
Hi,
I'm getting the same error when trying to start a server on a fresh machine. Sometimes I'll also get
Could not connect to mariadb server: Can't connect to MySQL server on 'db'
Sorry, this is no help for you, but at least you're not alone :-)
@christianvw tested the docker-compose and it worked fine.
I was getting the following error as well:
Could not connect to mariadb server: Can't connect to MySQL server on 'db'
I believe the issue is that the teamspeak
service can be created before the db
one, therefore not being able to resolve db
as an address.
Adding db
as a dependency to the teamspeak
services seems to solve the issue (see below).
version: '3.1'
services:
teamspeak:
image: teamspeak
restart: always
ports:
- 9987:9987/udp
- 10011:10011
- 30033:30033
environment:
TS3SERVER_DB_PLUGIN: ts3db_mariadb
TS3SERVER_DB_SQLCREATEPATH: create_mariadb
TS3SERVER_DB_HOST: db
TS3SERVER_DB_USER: root
TS3SERVER_DB_PASSWORD: example
TS3SERVER_DB_NAME: teamspeak
TS3SERVER_DB_WAITUNTILREADY: 30
TS3SERVER_LICENSE: accept
depends_on:
- db
db:
image: mariadb
restart: always
environment:
MYSQL_ROOT_PASSWORD: example
MYSQL_DATABASE: teamspeak
Maybe the documentation should be updated to reflect this.
I ran into the same issue. Reason for me was the firewall. Ubuntu Server 18.04. ships with ufw. Make sure to allow the necessary ports.
I get the same problem. It appeared spontaneously, after the image working for months. Now I can't get it to run again. Not firewall related, and I tried adding the db dependency, but it makes no difference.
I have no problem anymore for whatever reason with the docker-compose.yml
by @geropan - even without the addition of the dependecy, but this might help nevertheless.
Hi,
every time I want to create a teamspeak server using docker-compose, the database connection can't be established even using the example
docker-compoye.yml
.docker-compose.yml
error
What could be the mistake here?