This article is a mirror article of machine translation, please click here to jump to the original article.

View: 12163|Reply: 0

[linux] How to confirm that the MySQL service has been started under Linux CentOS

[Copy link]
Posted on 11/13/2017 11:57:21 AM | | | |
Linux CentOS is generally used as a server, so the MySQL service should be automatically started when it is booted. Under normal circumstances, the chkconfig command is used to view the service that is automatically started on startup:

#chkconfig --list
The actual use is as follows:



You can see that 2~5 of mysql is on, indicating that the mysql service will be started automatically by random start;



However, whether mysql is really started and whether it is really running, it needs to be determined by querying the monitoring port or querying process, and the following two methods can confirm whether mysql is starting and running:

Method 1: Query the port

#netstat -tulpn
The actual use is as follows:



MySQL monitors TCP port 3306, and the last line of the command operation result in the figure indicates that the MySQL service is running.



Method 2: Query the process

ps -ef | grep mysqld
If there are two processes, mysqld_safe and mysqld, the MySQL service is currently started.

The actual use is as follows:






Previous:MySQL configuration file my.cnf is explained in detail
Next:2017.11.13Server Failure Analysis
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com