showglobalvariableslike'port';+---------------+-------+|Variable_name|Value"/> showglobalvariableslike'port';+---------------+-------+|Variable_name|Value">

Home >Database >Mysql Tutorial >How to check the port number of mysql in ubuntu

How to check the port number of mysql in ubuntu

WBOY
WBOYforward
2023-06-03 21:46:022947browse

1. Log in to mysql.

Open the terminal and enter the command: "# mysql -uroot -p".

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

Enter password: Enter the database password;

2. Then enter the command "show global variables like 'port';" to view the port number.

mysql> show global variables like 'port';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| port | 3306 |
+---------------+-------+
1 row in set (0.00 sec)

Here 3306 is the port number.

The above is the detailed content of How to check the port number of mysql in ubuntu. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:yisu.com. If there is any infringement, please contact admin@php.cn delete