Database ports: MySQL 3306, PostgreSQL 5432, MongoDB 27017, Redis 6379 and others
What the IANA registry records for these ports, and how to use them safely.
What IANA records
| Port | Protocols | Registered name | IANA description | Assignee | Reference | Note |
|---|---|---|---|---|---|---|
| 1433 | tcp, udp | ms-sql-s | Microsoft-SQL-Server | n/a | n/a | |
| 1521 | tcp, udp | ncube-lm | nCube License Manager | Maxine Yuen | n/a | Unauthorized Use Known on port 1521 |
| 3306 | tcp, udp | mysql | MySQL | Monty | n/a | |
| 5432 | tcp, udp | postgresql | PostgreSQL Database | Tom Lane | n/a | |
| 27017 | tcp | mongodb | Mongo database system | MongoDB Inc. | n/a | |
| 6379 | tcp | redis | An advanced key-value cache and store | Salvatore Sanfilippo | n/a |
The defaults
| Port | Database |
|---|---|
| 1433 | Microsoft SQL Server |
| 1521 | Oracle |
| 3306 | MySQL and MariaDB |
| 5432 | PostgreSQL |
| 27017 | MongoDB |
| 6379 | Redis |
These are defaults from the registry and from the products' conventions; each can be changed in the configuration.
The most important rule
A database should talk only to the application servers that need it. If a database port is open to the whole internet, anyone can try to log in, and several databases have, in the past, been installed with no password at all, which led to many public data leaks. Check your own servers: the lists of open ports tell you.
Safe habits
- Bind the database to a private address (or localhost) in its configuration, not to every address.
- Block the port in the firewall except from the application servers.
- Use strong passwords and separate accounts for each application with the minimum rights.
- Turn on encryption for connections that cross a network.
- Do not use default accounts and empty passwords. Redis in particular is often set up without a password for convenience; set one.
- Back up and test the restore.
For developers on a laptop
Connecting to a remote database from your laptop? Use an SSH tunnel or a VPN rather than opening the database port to the internet.
This is an independent guide. It is not connected with IANA, the IETF or any network equipment maker. Address and port data come from the IANA registries as fetched on 14 November 2026; RFC texts were read from rfc-editor.org. Check the originals for anything you rely on.