HiveBrain v1.2.0
Get Started
← Back to all entries
snippetsqlMajor

How do I disable MySQL on Linux from starting on boot or statup?

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
startingbootdisablemysqllinuxhowstatupfrom

Problem

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?

Solution

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

Code Snippets

systemctl list-unit-files '*mariadb*' '*mysql*'
sudo systemctl disable mysql
sudo systemctl stop mysql.service
sudo systemctl start mysql.service

Context

StackExchange Database Administrators Q#208612, answer score: 20

Revisions (0)

No revisions yet.