Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a MySQL server running under Raspbian on my Raspberry Pi. How can I prevent the MySQL server starting on system startup?

I read everywhere that I have to make changes in the /etc/init/mysql.conf file or do echo "manual" >> /etc/init/mysql.override, but in my /etc/init/ there is no file at all with mysql in its name.

share|improve this question

I have this same issue on my server too. I dont want pure-ftpd to start.

This may not be the answer you like, but there is a sort of "ghetto" work around:

Before exit 0 in the /etc/rc.local script add this line:

sudo pkill <process name>

you can just find the process name by using top and have the sql server running.

if you dont like the pkill, you can put this inside your rc.local

sudo service stop <service name>

You can get an idea of the service name of your service name by running in terminal:

find /etc/rc* | grep "sql"

Rc.local gets executed after all the startup scripts so the sql will be up for less than a second but will immediately terminate.

share|improve this answer

# apt-get install sysv-rc-conf


# sysv-rc-conf

Then just look for mysql and uncheck all runlevels. You can also disable other run time scripts, but be careful with ones you don't know about as many are needed for a properly functioning system.

share|improve this answer

According to the MySQL 5.0 Reference Manual you may find an init.d script responsible for starting the service at boot.

If that's the case, consider the following:

Determine if you have an init.d script:

sudo ls -al /etc/init.d/*sql*

Take note of the name, according to the docs it should be mysql.server, it may also be symlinked as mysql.

Disable via update-rc.d command:

If the name of the script is in fact mysql.server, then this command should disable the service:

sudo update-rc.d mysql.server disable
sudo update-rc.d mysql.server stop

In theory you can still start/stop it on demand:

sudo chmod +x /etc/init.d/mysql.server
sudo /etc/init.d/mysql.server start
sudo /etc/init.d/mysql.server stop

If you wanted to permanently remove it:

sudo chmod -x /etc/init.d/mysql.server
sudo update-rc.d mysql.server remove
sudo killall --regex .*mysql.*
sudo reboot

Hope that works for you.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .