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?
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It only takes a minute to sign up.Sign up to join this community
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
In Ubuntu 18.04,
sudo systemctl disable mysql will prevent
mysql-server from autostarting on boot.
For linux, there are 3 main init systems:
SysV. Although nearly all Linux systems run on Systemd. The other two init systems might also co-exist in your system.
Systemd, use command
sudo systemctl disable mysql;
echo manual >> /etc/init/mysql.override;
SysV, run the following command
sudo update-rc.d mysql disable
If you'd like to find which init system is running on your server, please read this answer.