Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top 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

share|improve this question
when you say I cant set the permissions, you used sudo chmod 777FILE-NAME ? btw 777 is kinda a security risk: – Dr_Bunsen Aug 7 '12 at 9:17
Hnmmm... I'll try that. – Jim Thio Aug 8 '12 at 15:18

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.