
- Learn MySQL
- MySQL - Home
- MySQL - Introduction
- MySQL - Installation
- MySQL - Administration
- MySQL - PHP Syntax
- MySQL - Connection
- MySQL - Create Database
- MySQL - Drop Database
- MySQL - Select Database
- MySQL - Data Types
- MySQL - Create Tables
- MySQL - Drop Tables
- MySQL - Insert Query
- MySQL - Select Query
- MySQL - Where Clause
- MySQL - Update Query
- MySQL - Delete Query
- MySQL - Like Clause
- MySQL - Sorting Results
- MySQL - Using Join
- MySQL - NULL Values
- MySQL - Regexps
- MySQL - Transactions
- MySQL - Alter Command
- MySQL - Indexes
- MySQL - Temporary Tables
- MySQL - Clone Tables
- MySQL - Database Info
- MySQL - Using Sequences
- MySQL - Handling Duplicates
- MySQL - SQL Injection
- MySQL - Database Export
- MySQL - Database Import
What Is the Default MySQL Port Number?
MySQL uses port number 3306 by default.
3306 Port Number
3306 port number is used by MySQL protocol to connect with the MySQL clients and utilities such as ‘mysqldump’. It is a TCP, i.e Transmission Control Protocol.
Vulnerabilities
Let us see if there are any vulnerabilities while using this default port −
In general, port 3306 shouldn’t be opened since it could make the server vulnerable to attack. If the user needs to connect to the database remotely, there are many other secure options, instead of opening the port 3306.
One of the secure options includes using an SSH tunnel. On the other hand, if it is required to open port 3306, the user has to ensure to restrict the IP addresses which can access it so that the connection can’t be accessed by untrusted hosts. Even though MySQL default port is 3306, it doesn’t necessarily mean that MySQL service will always use that port.
If the user wants to verify the port or see if MySQL is using a different port, it can be done by running a short SQL query.
SHOW VARIABLES WHERE Variable_name = 'port';
- Related Articles
- MySQL Server port number?
- How to make a MySQL Connection in JAVA? What is the port number to set on locahost?
- What is Network Port?
- What is Port Forwarding?
- What is the default sort order in MySQL tables?
- What is the default type of a hexadecimal value in MySQL?
- What is the Default Gateway?
- How to find out port of MySQL Server?
- How to get the port number of the processes using PowerShell?
- Port number for SAP HANA Cockpit offline administration
- SAP connector failed, use of port number 3350
- Is INNODB enabled by default in MySQL?
- What is meant by Default Risk and Default Premium?
- What is the default constructor in C#?
- What do you mean by default MySQL database for the user?
