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
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
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
systemctl
because if I need to run a different action than the normal stop/start/restart commands available via service
I would only need to remember one command. This post has mode details on this https://askubuntu.com/a/903360/8698
– Dan
May 25 '21 at 09:11