Home Net Guide

Home / Port numbers / Port 3306

Port 3306: MySQL and MariaDB

Connections to MySQL and MariaDB databases. Port 3306 uses TCP.

Port
3306
Commonly used for
MySQL and MariaDB
Transport
TCP
Encrypted
Optional (TLS)
Range
User (registered) port, 1024 to 49151
Our advice
Keep it closed to the internet
IANA registration
mysql MySQL (TCP, UDP)

Registration: IANA Service Name and Transport Protocol Port Number Registry, retrieved 15 November 2026. The registered name can differ from the everyday use, because popular software often adopts a port without registering it. The description and advice are written by Home Net Guide and describe common practice: any program can be set to use any port.

What port 3306 is used for

Port 3306 is the default for MySQL and its relative MariaDB, the databases behind a large share of websites, including most WordPress installations. The web application connects to it to read and store its data.

Should port 3306 be open?

On a typical website the database and the web server are on the same machine or private network, so 3306 never needs to face the internet. Exposed servers are scanned for weak passwords, and attackers have wiped databases and left ransom notes. Bind it to localhost or a private address, and use an SSH tunnel or VPN for remote administration.

Related ports

  • Port 5432 (PostgreSQL): connections to PostgreSQL databases
  • Port 1433 (Microsoft SQL Server): connections to Microsoft SQL Server databases
  • Port 6379 (Redis): the Redis in-memory data store and cache
  • Port 27017 (MongoDB): connections to MongoDB databases

See all port numbers for the full list and how ports, TCP and UDP work.

Previous: Port 3268 (Active Directory Global Catalog) · Next: Port 3389 (RDP)