Hi all,
What I thought would be a routine task is already costing me half a day, and I have no idea what else I can try. I’m assuming it’s a networking problem, but I’ll let you be the judge.
This is my docker-compose.yml:
services:
database:
image: mysql:8.0
environment:
MYSQL_DATABASE: wbfeu
MYSQL_ROOT_PASSWORD: root
ports:
- "3306:3306"
Brought up the container, seems to be working fine:
$ docker exec -it server-database-1 mysql -uroot -proot
mysql: [Warning] Using a password on the command line interface can be insecure.
...
mysql> SHOW DATABASES;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| sys |
| wbfeu |
+--------------------+
5 rows in set (0.01 sec)
Then, preparing a MySQL connection in DBeaver, I set host to localhost or 127.0.0.1 (tried both), username and password to root.
I keep getting
Communications link failure
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
Can not read response from server. Expected to read 4 bytes, read 0 bytes before connection was unexpectedly lost.
Also tried the same procedure with Postgres and MariaDB containers, and while errors are slightly different, I believe the problem is the same.
When I had the MariaDB container up, the error contained something like Can't connect to local server through socket.
Any ideas?