There are many services under Linux. Today I will write about how to check whether the service is started, using mysql as an example.
1. Use the command # service mysqld status command to check the startup status of mysql as shown in the figure: mysqld is stopped, which means that the mysql service is stopped. If it is mysqld is running, then It means that the mysql service is started
##Recommended Manual :MySQL Development Manual
2. Use the command chkconfig --list command to view 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 has not been 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 has not started
4. Use the command chkconfig --list | grep on command to check the startup status of mysql as shown in the figure: If the mysql service has been started, then here will be There is this service
5. Use the command chkconfig --list | grep off command to check the startup status of mysql as shown in the figure Shown: If the mysql service is not started, then there will be this service
6. Use the command ps aux | grep The mysqld command is used to view the startup status of mysql as shown in the figure: The following figure compares the status of startup and non-startup
##7. 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.
# Recommended related articles:
1.How to check the number of connections and connection status in MySQL
Related video recommendations:
1.MySQL Authoritative Development Guide (Tutorial)
The above is the detailed content of How to check whether mysql is started in Linux?. For more information, please follow other related articles on the PHP Chinese website!