1

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.

3 Answers 3

0

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.

0

# apt-get install sysv-rc-conf

then

# 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.

0

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.

You must log in to answer this question.

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