Linux, how to start, stop and restart MySQL

First, start-up mode

  • Linux command to start using the service: service mysqld start
  • Use mysqld script to start: /etc/inint.d/mysqld start
  • Use safe_mysqld start: safe_mysqld &

Second, stop

  • Start using the service: service mysqld stop
  • Use mysqld script to start: /etc/inint.d/mysqld stop
  • mysqladmin shutdown

Third, restart

  • Use the restart service: service mysqld restart
  • Use script mysqld restart: service mysqld restart

Small tips: check whether MySQL port has been used, use netstat -anp command to view the server port usage.

Guess you like

Origin www.cnblogs.com/huainanhai/p/11323257.html