Experience of emoving mysql in debian/ubuntu forcefully

I had faced this instance where there ocurred problem with mysql configuration in debian. Something went wrong with the configuration and could not be traced out. We needed to fix it soon and reinstall was the easy option as there was no useful data.
But, the package couldn’t be removed because mysql is stopped before removing, Here, what was happening was that the init script would neither start or stop mysqld due to configuration error. Thus, the package couldn’t be removed as it failed to stop mysql.
So, thus I followed a hack’ish kind of a method to remove mysql.
First I killed mysqld by using top. Then I edited the file /var/lib/dpkg/mysql-server.prerm to remove the relevant section. So, now when I remove the package, the script won’t try to stop mysql-server.
Thus, I was cleanly able to remove the package without any problems.
Also, you get choice whether you want to keep your databases or remove them. Thus, is safe if you have important database.
Though, this method doesn’t have any bad side effects as far as I know, but still it would be better to sort out the configuration issues but here I had no other choice as it was important to remove it quickly and also there were no important configuration saved.

Tagged on: , , , ,

Leave a Reply

Your email address will not be published. Required fields are marked *