I want to completely remove and re-install mysql on Ubuntu 11.10. I've tried removing it by running:
apt-get remove --purge 'mysql-.*'
But when I re-install it, the old databases are still there, so it obviously wasn't completely removes. How do I remove:
- the server
- databases
- configuration files
/var/lib/dpkg/info/mysql-server-5.1.postrm
clearly has a block of code in place that should be removing/var/lib/mysql
if the purge executed properly./var/lib/mysql
if/usr/sbin/mysqld
if it isn't executable. Alas, that file is provided by mysql-server-core-5.1. Because mysql-server-5.1 depends on mysql-server-core-5.1, during a removal mysql-server-5.1 is removed first; thus/usr/sbin/mysqld
will still exist and the data directory won't be removed. (Verified by runningdpkg --force-depends --purge mysql-server-core-5.1
and thendkg --force-depends --purge mysql-server-5.1
. N.B. this is not a solution to the question.)