
MySQL database. Never expose on public IP — use SSH tunnel or private VPC only. Standard TCP port, used by the MySQL service.
Free online tool — ping & port checker: instant results, no signup.
Port 3306 is reserved by IANA for the MySQL service. MySQL database. Never expose on public IP — use SSH tunnel or private VPC only.
To find out if port 3306 is open on your host (or a third-party's — for diagnostics), use our port checker. Enter a domain and a port number — results arrive in 1-2 seconds.
An open port is a potential attack vector. General rules:
Port 3306, the default port for MySQL, is a common target for attackers due to its widespread use. Exposing this port to the public internet can create significant security vulnerabilities, allowing unauthorized access to your database. Attackers may exploit weak passwords, unpatched vulnerabilities, or configuration errors to gain access.
To mitigate these risks, consider the following security measures:
By implementing these security practices, you can significantly reduce the risk of unauthorized access to your MySQL database.
To verify if your MySQL server is actively listening on port 3306, you can use various command-line tools depending on your operating system.
Here are some practical commands:
sudo netstat -tuln | grep 3306 tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN netstat -ano | findstr :3306 mysql -u username -p -h localhost -P 3306 In case you don't receive any output or an error occurs, it may indicate that MySQL is not running or listening on the specified port.
While port 3306 is the default for MySQL, changing it can enhance security by obscuring the database service from automated attacks targeting the default port. To configure MySQL to use a different port, follow these steps:
1. **Edit the MySQL Configuration File:** Open the MySQL configuration file, typically located at:
/etc/mysql/my.cnf or
/etc/my.cnf 2. **Change the Port Number:** Locate the line that specifies the port:
port = 3306 Change it to your desired port, for example:
port = 3307 3. **Restart MySQL Service:** After saving your changes, restart the MySQL service to apply the new configuration:
sudo systemctl restart mysql or
sudo service mysql restart 4. **Update Firewall Rules:** Ensure that your firewall allows traffic on the new port:
sudo ufw allow 3307/tcp 5. **Connect Using the New Port:** When connecting to your database, specify the new port:
mysql -u username -p -h localhost -P 3307 By following these steps, you can effectively change the port MySQL listens on, enhancing your database's security posture.
Every open port is an attacker's entry point. If the service is not used (or uses a different port), close it to minimise attack surface.
From a local machine: nc -zv hostname 3306 or telnet hostname 3306. The online checker is simpler — from different IPs, one click.
Free plan — 10 monitors, checks every 5 min, no card required. Upgrade for 1-minute interval and multi-region monitoring.