A few days ago I installed mysql-server on a machine and then discovered that it was putting it's data file on a partition without nearly enough room. So (because there was nothing I cared about in the DB) I shut it down, sym-linked /var/lib/mysql to a blank directory on another partition and tried to start it back up.

In short; MySQL now won't start. Upstart seems to think it's running (that is if start mysql doesn't hang) but there is no mysqld process. I've tried re installing (apt-get purge mysql-server; apt-get insatll mysql-server) but it seems to be keeping something around (for one thing, it's not asking me to set the root password like it did the first time) and it still wont start.

How do I do a clean reinstall that completely ignores anything that the last install did?

Oh, and is there a way to tweak the config files before apt-get starts up mysqld?


You can force remove all files including the configuration files using the command:

$ sudo apt-get purge --force-yes mysql-server

Then, install as usual.

$ sudo apt-get install mysql-server
| improve this answer | |
  • Just tried that. No Joy. It acts, as far as I can see, exactly the same as the previous attempt without the --force-yes. – BCS Dec 15 '10 at 17:28

I'm going to take a punt that you're running Ubuntu, and have AppArmor installed. I got bitten by exactly this, late last week, migrating from a machine running 8.04 to a new host running 10.04.

I chose to disable AppArmor, but just as a test, try something like: /etc/init.d/apparmor stop then try starting MySQL again.

You can also reconfigure which directories AppArmor restricts MySQL to by editing /etc/apparmor.d/usr.sbin.mysqld.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.