Home > Operation and Maintenance > Linux Operation and Maintenance > How to query mysql port in linux

How to query mysql port in linux

青灯夜游
Release: 2022-06-15 14:39:18
Original
14268 people have browsed it

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
Copy after login

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!

Related labels:
source:php.cn
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