Home >Database >Mysql Tutorial >How to stop mysql service under linux

How to stop mysql service under linux

青灯夜游
青灯夜游Original
2022-02-22 11:35:1027055browse

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. .

How to stop mysql service under linux

The operating environment of this tutorial: linux5.9.8 system, mysql8 version, Dell G3 computer.

Two ways to view the mysql service under Linux:

Method one:

[root@localhost bin]ps -ef|grep mysql

Method two:

[root@localhost bin]netstat -nlp

Two ways to close and stop the mysql service under Linux One way:

Command line mode:

[root@localhost ~]mysqladmin -u root shutdown

Service mode:

[root@localhost ~]service mysql stop

Two ways to start the mysql service under Linux:

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn