Which port does MySQL listen on by default?

Prepare for the eLearnSecurity Junior Penetration Tester exam with our comprehensive quiz platform. Improve your skills with multiple-choice questions, detailed explanations, and exam tips. Get exam ready with ease!

Multiple Choice

Which port does MySQL listen on by default?

Explanation:
MySQL listens on 3306 by default. This standard port is what the server binds to when you install MySQL and keep the default configuration, so clients connect to the server using host:3306 unless you explicitly change it. You can verify or change this in the server’s config (port = 3306 in my.cnf or my.ini) and confirm from the server with commands like SHOW VARIABLES LIKE 'port', or by observing the listening socket with netstat/ss. The other port numbers correspond to different services—1433 is used by Microsoft SQL Server, 21 is FTP, and 3389 is Remote Desktop—so they aren’t the default for MySQL.

MySQL listens on 3306 by default. This standard port is what the server binds to when you install MySQL and keep the default configuration, so clients connect to the server using host:3306 unless you explicitly change it. You can verify or change this in the server’s config (port = 3306 in my.cnf or my.ini) and confirm from the server with commands like SHOW VARIABLES LIKE 'port', or by observing the listening socket with netstat/ss. The other port numbers correspond to different services—1433 is used by Microsoft SQL Server, 21 is FTP, and 3389 is Remote Desktop—so they aren’t the default for MySQL.

Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy