Home  >  Article  >  Operation and Maintenance  >  How to check whether mysql is running in linux

How to check whether mysql is running in linux

青灯夜游
青灯夜游Original
2021-12-02 16:20:5931051browse

View method: 1. Execute the "service mysqld status" command. If "mysqld is running" is output, it means that mysql is running; 2. Execute the "chkconfig --list" command. If the status of the mysqld service is off, it is not running.

How to check whether mysql is running in linux

The operating environment of this tutorial: linux5.9.8 system, mysql8 version, Dell G3 computer.

1. Use the command service mysqld status command to check the startup status of mysql

As shown in the figure:

mysqld is stopped That means mysql The service is stopped. If mysqld is running, it means that the mysql service is started.

How to check whether mysql is running in linux

How to check whether mysql is running in linux

2. Use the command chkconfig --list command to check the startup status of mysql

As shown in the figure: Find the mysqld service in the following services. If the status is off, it means that the mysql service is not started

How to check whether mysql is running in linux

3. Use the command chkconfig --list mysqld command to check the startup status of mysql

As shown in the figure: Find the mysqld service in the following services. If the status is off, it means that the mysql service is not started

How to check whether mysql is running in linux

4. Use the command chkconfig --list | grep on to check the startup status of mysql

As shown in the picture: If the mysql service has been started, then there will be this service here

How to check whether mysql is running in linux

5. Use the command ps aux | grep mysqld command to view mysql The startup status of
#6. Use the command pidof mysqld command to check the startup status of mysql

As shown in the figure: If the PID is displayed, it means that the program has started. If the PID is not displayed, it means that the program has not started.

How to check whether mysql is running in linux

How to check whether mysql is running in linux

##[Related recommendations: Linux video tutorial,

mysql video tutorial

The above is the detailed content of How to check whether mysql is running 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