Home  >  Article  >  Database  >  What are the commands to start and shut down the mysql service in Linux?

What are the commands to start and shut down the mysql service in Linux?

WBOY
WBOYforward
2023-05-31 12:12:022587browse

What are the commands to start and shut down the mysql service in Linux?

1. Two ways to view the mysql service under Linux:

Method one:

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

Method two:

 [root@localhost bin]netstat -nlp1

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

Command line mode:

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

Service mode:

 [root@localhost ~]service mysql start
 如果服务在启动状态,直接重启服务用以下命令:
 [root@localhost ~]service mysql restart123

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

Command line mode:

 [root@localhost ~]mysqladmin -u root shutdown1

Service mode:

 [root@localhost ~]service mysql stop

The above is the detailed content of What are the commands to start and shut down the mysql service in Linux?. For more information, please follow other related articles on the PHP Chinese website!

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