http://stuffthatspins.com/2011/01/08/ubuntu-10-x-completely-remove-and-clean-mysql-installation/ shows how to reinstall everything.
I want to do something like this without reinstalling data.
Obviously I can't execute this: delete preferences(the next find command will delete everything):
rm -rf /etc/mysql
find all files with “mysql” on / and delete them:
find / -iname ‘mysql*’ -exec rm -rf {} \;
Then I run
sudo aptitude purge mysql-server
sudo aptitude install mysql-server
But then I run into problem because I can't access some mysql-bin.0000x is not writeable or something.
If I keep mysql-bin.index empty or deleted it I got complaint that files are empty or inaccessible. I think the issue is that mysql doesn't have permission to access those file. However, I can't give them permission because the installation is supposedly automatic.
So what should I do?
This is for amazon-ec2