Home >Operation and Maintenance >Linux Operation and Maintenance >Two ways to view, start and shut down mysql in linux

Two ways to view, start and shut down mysql in linux

藏色散人
藏色散人forward
2021-11-11 14:14:293236browse

The following column linux system tutorial will introduce to you how to view, start and close mysql in Linux. I hope it will be helpful to friends in need!

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

2. Two ways to start the mysql service under Linux:

Command line mode:

[root@localhost bin]cd /usr/bin
[root@localhost bin]./mysqld_safe &

Service mode:

[root@localhost ~]service mysql start

If the service is in the starting state , directly restart the service with the following command:

[root@localhost ~]service mysql restart

3. Two ways to close the mysql service under Linux:

Command line method:

[root@localhost ~]mysqladmin -u root shutdown

Service method:

[root@localhost ~]service mysql stop

Recommended learning: "linux video tutorial"

The above is the detailed content of Two ways to view, start and shut down mysql in linux. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:juejin.im. If there is any infringement, please contact admin@php.cn delete