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.
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.
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
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
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
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
##[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!