Completely remove MySQL

Categories Uncategorized

As a reminder, if I ever get problems with MySQL authentication again. This are the commands I need to completely wipe MySQL and start getting asked for a password again.

sudo rm -rf /var/lib/mysql \
/var/lib/mysql/mysql \
/var/log/mysql \
/usr/lib/perl5/DBD/mysql \
/usr/lib/perl5/auto/DBD/mysql \
/usr/lib/mysql \
/usr/bin/mysql \
/usr/share/mysql \
/usr/share/dbconfig-common/internal/mysql \
/etc/init.d/mysql \
/etc/apparmor.d/abstractions/mysql \
/etc/mysql \
sudo apt-get remove --purge mysql-\*
sudo apt-get install mysql-server mysql-client

Credits to this post and this post.

Also,  this is a pretty cool guide to properly install MySQL in Ubuntu.