I installed MySQL using
sudo apt-get. Now I need to remove it from my system.
How can I do that?
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It only takes a minute to sign up.Sign up to join this community
I don't use Ubuntu much but what I think you should try is what I did.
I first typed this in command line :
sudo apt-get remove --purge mysql-server mysql-client mysql-common,
then followed with this below :
sudo apt-get autoremove
and finally typed this :
sudo apt-get autoclean.
I found that it was removed.
I forgot the MySQL root password and needed to reset. I tried this, but it didn't work, because it kept saying "can't write logs" or something similar.
My solution was to completely remove MySQL from Ubuntu 13.10 and fresh installation.
sudo apt-get remove --purge mysql-server mysql-client mysql-common sudo apt-get autoremove sudo rm -rf /var/lib/mysql
I had to run the last command because Ubuntu sometimes keeps some libs even you try to purge them all.
Now, I use this command to install MySQL server and client:
sudo apt-get install mysql-client mysql-server
Try this, It will fully wipeout out every single file of MySQL from your system:
sudo service mysql stop #or mysqld sudo killall -9 mysql sudo killall -9 mysqld sudo apt-get remove --purge mysql-server mysql-client mysql-common sudo apt-get autoremove sudo apt-get autoclean sudo deluser -f mysql sudo rm -rf /var/lib/mysql sudo apt-get purge mysql-server-core-5.7 sudo apt-get purge mysql-client-core-5.7 sudo rm -rf /var/log/mysql sudo rm -rf /etc/mysql
sudo -i service mysql stop killall -KILL mysql mysqld_safe mysqld apt-get --yes purge mysql* 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 ~/.mysql_history updatedb
Based on this answer and many others...