MySQL and MariaDB client connections.
MySQL and MariaDB client connections.
Do not expose to the internet. Keep it off the internet: bind to 127.0.0.1 or a private interface (bind-address) and allow only application servers in the firewall. Exposed MySQL servers face constant brute-force attempts and ransom attacks that dump and delete databases. Use TLS for connections between hosts.
sudo ss -tlnp 'sport = :3306'sudo lsof -nP -i :3306sudo netstat -tlnp | grep ':3306 'netstat -ano | findstr :3306Get-NetTCPConnection -LocalPort 3306 -State Listen | Select LocalAddress,OwningProcessnc -vz -w 5 HOST 3306Test-NetConnection HOST -Port 3306sudo ufw deny 3306/tcpsudo iptables -A INPUT -p tcp --dport 3306 -j DROPsudo nft add rule inet filter input tcp dport 3306 dropNew-NetFirewallRule -DisplayName 'Block TCP 3306' -Direction Inbound -Protocol TCP -LocalPort 3306 -Action BlockAll port numbers · Open port checker
Assignment data: IANA port number registry (public domain), retrieved 2026-11-10.