4

I had downloaded the generic Linux 64 bit MySQL 5.6.17 TAR archive from http://dev.mysql.com/downloads/mysql/ and installed on my 64 bit Ubuntu 14.04, following the instructions at http://dev.mysql.com/doc/refman/5.6/en/binary-installation.html.

I am having some problems with the server, so i want to uninstall and do a fresh installation. But if i try the usual apt-get remove mysql-server(as per How do I uninstall Mysql?), i get :

Package 'mysql-server' is not installed, so not removed

I am guessing this is because i did not use apt-get to install in the first place. I had used scripts/mysql_install_db as per the instructions.

So is there some other way to uninstall MySQL server or is it ok to just delete the installation folder?

Edit

$ dpkg --get-selections | grep -v deinstall | grep "mysql"

gives the below result :

libdbd-mysql-perl               install
libmysqlclient18:amd64          install
mysql-client                    install
mysql-client-5.5                install
mysql-client-core-5.5           install
mysql-common                    install
mysql-workbench-community       install
faizal
  • 3,037

4 Answers4

4

Assuming you need to completely remove mysql related packages and its configs, please try below;

sudo apt-get remove --purge mysql*     # will remove all relating packages and its config
sudo apt-get autoremove               
sudo apt-get autoclean

And above command will completely remove all mysql related packages.

Hope it helps!!

AzkerM
  • 10,390
3

If you installed MYSql from .tar.gz file, you can't able to uninstall it through Ubuntu's native package management system (apt-get).

Find the uninstall.sh script inside the extracted directory and run it to completely remove all the files related to MYSQL.

Avinash Raj
  • 80,446
1

The following will uninstall everything that contain mysql.

apt-get remove --purge mysql*.*
apt-get autoremove
apt-get autoclean

Then run again the following to check any remaining packages.

dpkg --get-selections | grep -v deinstall | grep "mysql"

In my case, I only see mysql-common.

Reinstall and everything should work.

0

For me this worked, without putting myself at risk of removing core MySQL services.

sudo apt-get remove --purge mysql-workbench*