Port 3306/tcp: MySQL / MariaDB
Category: Databases. Range: registered. Status: iana registered.
What runs here
The IANA-registered default port for the MySQL Client/Server binary protocol, used identically by MariaDB (a MySQL-compatible fork). Clients authenticate and exchange queries/result sets with the server over this single persistent TCP connection; local connections on the same host commonly use a Unix socket instead, bypassing the network port entirely.
Why it matters
3306 exposed to the internet is one of the most heavily mass-scanned database ports there is, targeted for weak/blank root passwords, and (depending on server configuration), the FILE privilege combined with INTO OUTFILE/LOAD_DATA can be abused for file read/write on the host. Compromised MySQL instances are a recurring vector for both credential-stuffing campaigns and opportunistic ransom-note/data-wiping attacks against exposed cloud databases.
Where you see it
Legitimately: application/ORM connections, replication traffic between primary and replica servers, and administrative tools (MySQL Workbench, mysqldump). Anomalously/maliciously: internet-facing 3306 receiving credential-stuffing traffic, successful root logins from unfamiliar source IPs, or query patterns consistent with SELECT ... INTO OUTFILE used to write a webshell to disk.
What to look for
| Signal | What it means |
|---|---|
| Root login from unexpected source | A successful MySQL root (or other high-privilege account) authentication from an IP outside the known application tier is the single highest-value pivot point in a database compromise timeline. |
| INTO OUTFILE / LOAD_FILE usage | Queries using INTO OUTFILE or LOAD_FILE() are a classic technique for reading arbitrary server files or writing a webshell when the FILE privilege and secure_file_priv aren't tightly restricted. |