centos start up and shut down mysql service

1, the configuration of MySQL at startup

 

  1.  
    chkconfig -- add mysql
  2.  
    chkconfig mysqld on


2, the command enable / disable MySQL instance

 

 

  1.  
    service mysqld start/stop
  2.  
    /etc/init.d/mysqld start/stop


3, ordered the closure of MySQL

 

 

mysqladmin -p -u root shutdown


4, check whether the real start mysql

 

Method One: query port

 

#netstat -tulpn


MySQL monitor TCP port 3306 is the last line of the figure that is the result of the operation command MySQL service in operation.

 

Method Two: query process

 

ps -ef | grep mysqld


If there are two processes mysqld_safe and mysqld, indicating that MySQL service is currently in start-up state.

Guess you like

Origin www.cnblogs.com/xuwanchao/p/11433130.html