MySQL – How to Disable MySQL on Linux from Starting on Boot

linuxmariadbMySQLUbuntu

After adding MySQL to Ubuntu, it automatically starts up on server boot. I would like it to not start up with the system.

How can I disable it and manually start it?

Best Answer

MariaDB use systemd as does MySQL. To disable MySQL or MariaDB, from starting on bootup, run

systemctl list-unit-files '*mariadb*' '*mysql*'

If you see mysql.service, try disabling that one first.

sudo systemctl disable mysql

Now you can start and stop MySQL with

sudo systemctl stop mysql.service
sudo systemctl start mysql.service