您的位置:宽带测速网 > 网络知识 > ubuntu下怎么查mysql的端口号

ubuntu下怎么查mysql的端口号

2025-06-17 10:27来源:互联网 [ ]

ubuntu下查mysql端口号的示例:

1、登录mysql。

打开终端输入命令:“# mysql -uroot -p”。

[root@localhost~]#mysql-uroot-p

Enter password: 输入数据库密码;

2、再输入命令“show global variables like 'port';”查看端口号。

mysql>showglobalvariableslike'port';

+---------------+-------+

|Variable_name|Value|

+---------------+-------+

|port|3306|

+---------------+-------+

1rowinset(0.00sec)

这里3306即为端口号。