2

So far I've seen that these three commands do the same thing. Which is preferred or does it not matter which command I use?

sudo /etc/init.d/mysql stop

sudo service mysql stop

sudo systemctl disable mysql

Neo
  • 155

1 Answers1

4

If you are using a modern version of MySQL, then the “best” method is the second on your list:

sudo service mysql stop

This does the same as the first, but in a manner consistent with other services on the system, making it easier to remember and work with long term.

Abstain from using the last one. Disabling and stopping are not always synonymous

matigo
  • 24,752
  • 7
  • 50
  • 79