0

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?

BCS
  • 1,065
  • 2
  • 15
  • 24

2 Answers2

0

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
Khaled
  • 36,533
  • 8
  • 72
  • 99
  • 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
0

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.

James Green
  • 895
  • 1
  • 9
  • 23
  • 1
    For people like me who don't know what it is: http://en.wikipedia.org/wiki/AppArmor – BCS Dec 15 '10 at 18:09