Since restoring from a backup mySQL won't start

April 3, 2015 2.1k views
MySQL Backups

Hello there,

I have a Ubuntu 12.04.3 LTS (GNU/Linux 3.8.0-29-generic x86_64) droplet which I ballsed up by attempting to upgrade Ubuntu.

So I restored it to a backup from 1 week ago. However, I can't for the life of me seem to get mySQL to start. After restoring mySQL comes up for a matter of minutes and then dies refusing to start again.

Looking in syslog, it seems to die when this comes up:

Apr 3 23:47:25 localhost kernel: [ 360.410338] type=1400 audit(1428101245.773:24): apparmor="STATUS" operation="profilereplace" name="/usr/sbin/mysqld" pid=2456 comm="apparmorparser"

Trying service mysql start come back with this:

start: Job failed to start

Does anyone have any idea what might be happening please?

  • try:

    dpkg-reconfigure mysql-server-5.5

  • Thanks I'll give that a go

  • Unfortunately that did not work:

    Skipping profile in /etc/apparmor.d/disable: usr.sbin.mysqld
    start: Job failed to start
    invoke-rc.d: initscript mysql, action "start" failed.

  • Try running MySQL manually, does it output any errors?

    sudo -u mysql -g mysql mysqld
  • If I try sudo -u mysql -g mysql mysqld I get:

    150404 19:29:06 [Warning] Using unique option prefix keybuffer instead of keybuffersize is deprecated and will be removed in a future release. Please use the full name instead.
    150404 19:29:06 [Warning] option 'thread
    stack': unsigned value 65536 adjusted to 131072

    If I try just mysql I get:

    ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (111)

  • I don't suppose you ended up finding a solution to this problem? I am encountering it right now with no luck so far.

  • Just out of curiosity, what was the problem when upgrading Ubuntu?

    I am just wondering if going ahead with the Ubuntu upgrade might be a better approach. There are a few tweaks to make, but its not that complex.

1 Answer

To be honest I can't remember what I did (as it was a few months ago now) but I managed to get dumps of the databases and then just fired up a new server to use only for my databases with a secure connection running between the web server and new database server. A better way to do it plus I set up regular database backups to avoid the issue happening again.

Have another answer? Share your knowledge.