Home > Database > Mysql Tutorial > body text

What is the default port number for MySQL?

WBOY
Release: 2023-09-01 21:41:02
forward
2500 people have browsed it

MySQL 默认端口号是多少?

MySQL uses port number 3306 by default.

3306 Port Number

The MySQL protocol uses the 3306 port number to connect to MySQL clients, utilities such as "mysqldump". It's a TCP, Transmission Control Protocol.

Vulnerabilities

Let's see if there are any vulnerabilities when using this default port -

In general, port 3306 should not be opened as it may make the server vulnerable attack. If users need to connect to the database remotely, there are many other security options than opening port 3306.

One of the security options includes using an SSH tunnel. On the other hand, if port 3306 needs to be opened, the user must ensure that the IP addresses that can access the port are restricted so that untrusted hosts cannot access the connection. Although the MySQL default port is 3306, this does not necessarily mean that the MySQL service will always use that port.

If the user wants to verify the port or see if MySQL is using a different port, this can be done by running a short SQL query.

SHOW VARIABLES WHERE Variable_name = 'port';
Copy after login

The above is the detailed content of What is the default port number for MySQL?. For more information, please follow other related articles on the PHP Chinese website!

source:tutorialspoint.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template