upstart failing to manage mysqld on Ubuntu 10.04
By Iain Cuthbertson
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 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 below to fix this issue. I hope this helps others :)]
Comments
Blago says: 14th June 2010 at 8:23 am
God bless you. I would’ve waisted another 2 hours…
Ryan says: 20th June 2010 at 10:27 pm
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
Iain says: 22nd June 2010 at 3:58 pm
Thanks Ryan.
Sergio says: 1st July 2010 at 12:09 am
Thank you both, the author of the post and Ryan for sharing his solution I confirm it worked for me too.
Simon G says: 14th June 2011 at 3:35 pm
Legend. Thank You!
fak3r says: 7th September 2011 at 10:15 pm
This worked for us after a day of staring at this and reading all the bug reports in Ubuntu forums trying to figure it out – thanks!
Marcus says: 22nd November 2011 at 7:04 pm
Woohoo – thanks @ OP and Ryan!