How to query mysql port in linux

青灯夜游
青灯夜游Original
2022-06-15 14:38:3714267browse

Two query methods: 1. Open the terminal and directly execute the "netstat -anp|grep mysql" command. You can view the mysql port number in the output result. 2. Open the terminal, execute the "mysql -uroot -p" command to log in to the mysql server, and then execute the "show global variables like 'port';" command to query the mysql port. The number displayed in the "port" line in the output result is the mysql port.

How to query mysql port in linux

The operating environment of this tutorial: linux7.3 system, mysql8 version, Dell G3 computer.

Two ways to query the mysql port on Linux

##Method 1: Open the terminal and directly execute the following command

netstat -anp|grep mysql

How to query mysql port in linux

#3306 is the port number.

Method 2: Log in to the mysql server and query the mysql port

1. Open the terminal and execute the

mysql -uroot -p command to log in to mysql

How to query mysql port in linux

2. Use the

show global variables like 'port'; command to view the port number

How to query mysql port in linux

3306 That is the port number.

[Related recommendations:

mysql video tutorial]

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

Statement:
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