
mysql默认端口号
MySQL is very popular database in the opensource community. While developing applications or connecting MySQL database we need to specify the MySQL port implicitly or explicitly. In this tutorial we will learn MySQL default port number and alternative port numbers.
MySQL是开源社区中非常流行的数据库。 在开发应用程序或连接MySQL数据库时,我们需要隐式或显式指定MySQL端口。 在本教程中,我们将学习MySQL默认端口号和备用端口号。
TCP 3306 (TCP 3306)
The default port for the MySQL service is TCP 3306. This port can be also used for MariaDB database server.
MySQL服务的默认端口是TCP3306。该端口也可用于MariaDB数据库服务器。
使用netstat命令列出 (List with netstat Command)
We can use netstat
command in order to list MySQL/MariaDB database server port number.
我们可以使用netstat
命令来列出MySQL / MariaDB数据库服务器端口号。
$ sudo netstat -p -l -n | grep mysql

We can see from output that port 3306
port is listening on the local interface 127.0.0.1
从输出中我们可以看到端口3306
端口正在本地接口127.0.0.1
上侦听
For MariaDB change grep mysql
with grep mariadb
对于MariaDB,使用grep mariadb
更改