Disable remote mysql connection (Debian, Firewall)

I want to disconnect external connections to my mysql in debian, with a firewall. I only know that it should be inside the iptables.test.rules file

Thanks in advance.

+4
source share
2 answers

The best way to disconnect external connections to your MySQL is to install it bind-address=127.0.0.1in the my.cnfconfiguration file. If you still need to block MySQL external access using the firewall, you delete or reject all packets sent to port 3306.

+4
source

To remove all packets sent to port 3306, use iptables:

-A INPUT -p tcp -m tcp --dport 3306 -j DROP
0

All Articles