How to shut down mysql in centos: 1. Check the MySQL service through the "#chkconfig --list mysqld" command; 2. Use the "mysqladmin -p -u root shutdown" command to shut down mysql.
The operating environment of this tutorial: centOS6.8 system, MySQL5.7 version, Dell G3 computer.
How to close mysql in centos?
Starting and shutting down MySQL under Centos
1. Linux CentOS is generally used as a server, so the MySQL server should start randomly. Use the chkconfig command to view the services that start automatically after booting, as follows:
#chkconfig --list
Or just view the MySQL service
#chkconfig --list mysqld
You can see that mysql 2~5 is on, indicating The mysql service will start automatically when the machine starts.
2. Configure MySQL to start automatically at boot
chkconfig --add mysql chkconfig mysqld on3. Command to start/shut down the MySQL instance
service mysqld start/stop /etc/init.d/mysqld start/stop4. Command to shut down MySQL
mysqladmin -p -u root shutdown5. Check whether mysql is actually started
Method 1: Query port
#netstat -tulpn
Method 2: Query the process
ps -ef | grep mysqld
Recommended learning: "MySQL Video Tutorial"
The above is the detailed content of How to close mysql in centos. For more information, please follow other related articles on the PHP Chinese website!