How to stop the mysql service in Linux: 1. Execute the "mysqladmin -u root shutdown" command in the terminal to shut down the mysql service; 2. Execute the "service mysql stop" command in the terminal to shut down the mysql service. .
The operating environment of this tutorial: linux5.9.8 system, mysql8 version, Dell G3 computer.
Method one:
[root@localhost bin]ps -ef|grep mysql
Method two:
[root@localhost bin]netstat -nlp
Command line mode:
[root@localhost ~]mysqladmin -u root shutdown
Service mode:
[root@localhost ~]service mysql stop
Command line mode:
[root@localhost bin]cd /usr/bin [root@localhost bin]./mysqld_safe &
Service method:
[root@localhost ~]service mysql start 如果服务在启动状态,直接重启服务用以下命令: [root@localhost ~]service mysql restart
[Related recommendations:mysql video tutorial]
The above is the detailed content of How to stop mysql service under linux. For more information, please follow other related articles on the PHP Chinese website!