The answers to related questions forget to:
- remove the MySQL databases
- remove the
mysql
user - remove the logs in
/var/log
How do I uninstall MySQL completely?
The answers to related questions forget to:
mysql
user/var/log
How do I uninstall MySQL completely?
Building off of another answer, open a terminal (press Ctrl+Alt+T) and run the following:
If you want to delete the log of what you did while using the
mysql
client:If you want to delete the logs of what all users on the system did while using the
mysql
client (the other users might be unhappy with this):or for all logs including those outside of existing user home directories:
I found some help, but it did not remove everything. I added an asterisk before and after mysql like this:
Another way, that worked for me, was to use Synamptic Package Manager. On the left hand pane,where it says: All, Installed, etc. there is an entry for Not Installed (residual config.) (or similar wording). Under there I found options to clear all MySQL install files. This worked for MySQL 5.7.
I used a collab of 2 answers, first I ran this
sudo -i
service mysql stop
killall -KILL mysql mysqld_safe mysqld apt-get --yes purge mysql-server mysql-client
apt-get --yes autoremove --purge
apt-get autoclean
deluser --remove-home mysql
delgroup mysql
rm -rf /etc/apparmor.d/abstractions/mysql /etc/apparmor.d/cache/usr.sbin.mysqld /etc/mysql /var/lib/mysql /var/log/mysql* /var/log/upstart/mysql.log* /var/run/mysqld
updatedb
exit
Then checked, but still had an error, so as backup, I ran this within the terminal.
Worked perfectly.