I have Mariadb running in a container and can connect from terminal using the following command: mysql -h 172.18.0.2 -u username -psecret However, when attempting to set up in Dbeaver (a gui), I continue to get the error:
"Could not connect to 127.18.0.2:3308 : unexpected end of stream, read 0 bytes from 4 (socket was closed by server) unexpected end of stream, read 0 bytes from 4 (socket was closed by server) unexpected end of stream, read 0 bytes from 4 (socket was closed by server)"
The port is 3308, NOT 3306 - so I verified this is correct.
If I run:
docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' docker_mysql_1 I receive: 172.18.0.2
I have also attempted looking at Docker's IP addresses using docker ps and receive:
71a6e74bd790 mariadb:latest "docker-entrypoint.s…" 13 hours ago Up 33 minutes 3306/tcp, 0.0.0.0:3308->3308/tcp, :::3308->3308/tcp docker_mysql_1
I tried the ip address in there as well in dbeaver with no success.
Currently, I am attempting using the following credentials in dbeaver:
host: 127.18.02 (I've tried localhost and other variations of localhost ip) port: 3308 (I have tried 3306) and of course, the username and password. (I have tried username with "@localhost" and @ the ipaddress at end - no success)
I have tried with and without using a database in the options.
I am using the MariaDB driver in dbeaver.
It seems I need to do more to map or expose the port. I am new to Docker containers. Thank you in advance!
In the "Drivers Property" section of your database connection, there is an attribute called "allowPublicKeyRetrieval" (by the way, the same attribute exists in MySQL Workbench and may lead to the same issue). Set it to "true" and try again.