@
@
@Twitt2019-11-16 18:44:13
MySQL
@Twitt, 2019-11-16 18:44:13

I want to prohibit accessing mysql from the outside, why doesn't it come out through bind-address?

I want to make sure that only my VPS can access Mysql, which is raised in the docker. I took the my.cnf config and specified the IP address of the docker container in bind-address= (I got it like this docker inspect id_container | grep "IPAddress"). I did a docker restart of the container, but still I can access MySQL from my local PC. Why?
skip networking is commented out (if I uncomment it always Connection refused.)
How can I make sure that all calls to my MySQL from outside are closed?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Maxim Iontzev, 2019-11-16
@iontzev

You can also do this: --network host and only allow connections from 127.0.01

D
Dmitry, 2019-11-16
@q2digger

The easiest way is through iptables.

iptables -I DOCKER-USER -p tcp --dport 3306 -j DROP

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question