upstart failing to manage mysqld on Ubuntu 10.04

Installed Ubuntu 10.04 from ISO onto a blank virtual box machine.

All worked well for a while, until I recently did an aptitude safe-upgrade.

The next time I booted the system, mysql failed to start and refused to do so when I issued: sudo service mysql start

It would just hang there.

Tracked the issue down to this bug. How I maged to get get it to work:

In a terminal: sudo /usr/sbin/mysqld

In another terminial:

sudo service mysql start
sudo service mysql stop
sudo killall mysqld

Now mysql will start and stop on the system as it should.

[nb: this is a rough artical, I will flesh it out when I have more time]

[edit 27-05-2010: this is not a permanent fix and requires to be executed after every system start. Looking forward to a fix on this…]

[edit 22-06-2010: see Ryan’s comment to fix this issue. I hope this helps others :)]

7 thoughts on “upstart failing to manage mysqld on Ubuntu 10.04”

  1. Run this:

    sed -i -e ‘s/^exec /usr/sbin/mysqld/exec sudo -u mysql /usr/sbin/mysqld/’ /etc/init/mysql.conf

    and reboot. Mysql will be 100% manageable via upstart scripts.

    The issue was that the init scripts tried to run mysqld as user root, instead of user mysql. That sed one-liner there fixes the issue permanently.

    You could use nano or vi on /etc/init/mysql.con as well. Just change line 26 to read:

    exec sudo -u mysql /usr/sbin/mysqld

    instead of

    exec /usr/sbin/mysqld

Leave a Reply

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