jwallace.us

tech, tunes, and other stuff

Removing MySQL From Debian

If you simply wish to keep the MySQL service from loading on system startup, then an easy way to do that is to install either sysv-rc-conf or rcconf and turn off MySQL for the different runlevels. I prefer sysv-rc-conf for its old old school style, but they’re both really simple so it comes down to a matter of taste. To install both of these:

sudo apt-get install sysv-rc-conf rcconf

Once you have the utilities installed, just run them by either typing sysv-rc-conf or rcconf at the command line.

Now, if you’ve decided you’re really finished with MySQL, then you have a couple of options. You can either uninstall it leaving the configuration and data files, or you can completely remove it and all related files completely off your system.

In either case, the first step in removing MySQL is to stop the service:

$ sudo service mysql stop

Now MySQL is ready to be removed. To remove MySQL while saving your configuration and data files issue the following commands:

1
2
3
$ sudo apt-get remove mysql-server mysql-client mysql-common
$ sudo apt-get autoremove
$ sudo apt-get autoclean

To remove EVERYTHING, simply add the purge option:

1
2
3
$ sudo apt-get remove --purge mysql-server mysql-client mysql-common
$ sudo apt-get autoremove
$ sudo apt-get autoclean