J
J
just-not-me2019-05-27 19:34:36
MySQL
just-not-me, 2019-05-27 19:34:36

Why not connect to mysql from docker?

Good afternoon!
There is a droplet, a docker is running on it, the ip-address will be indicated by host-ip.
There is a second droplet on which mysql is running, its ip address will be indicated by mysql-ip.
If I execute from the host mysql -u user -p -h {mysql-ip}, then I connect successfully.
If I do the same from the docker container, I get

ERROR 1045 (28000): Access denied for user 'user'@'host-ip' (using password: YES)

At the same time, netstat on the mysql droplet says the following:
[email protected]:/var/log/mysql# netstat -na | grep 3306
tcp        0      0 0.0.0.0:3306            0.0.0.0:*               LISTEN
tcp        0      0 {mysql-ip}:3306      {host-ip}:58492    TIME_WAIT
tcp        0      0 {mysql-ip}:3306      {host-ip}:54170    ESTABLISHED

Accordingly, where TIME_WAITis the rejected connection.
Upd.
If you my.cnfdisable require_secure_transport = ONand recreate the user without REQUIRE SSL, then the connection is successful.
It turns out you need to dig in the direction of ssl ...

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question