Author Topic: MySQL failure. Any advice?  (Read 4122 times)

darrenmason

  • Addicted
  • *
  • Posts: 529
    • View Profile
MySQL failure. Any advice?
« on: October 27, 2011, 01:10:11 am »
Hi all,

My core power supply was having problems last night which meant that the core was instantly losing power and would need to be manually restarted. This happened a few times before I realised what was happening. I have now replaced the power supply and seems to be stable from that perspective - but it looks to have corrupted the databases.

mysqld will not start and when attempts are made to start it manually it fails after attempting to recover, blurts out a stack trace and advises to look at a couple of websites for more info. The websites just take me through attaching symbols to the stack trace etc which don't really help me at the moment.

Question is; can I somehow reinstall mysql without upsetting the rest of the system and having to do a reinstall? Anyone done anything like this?

regards
Darren

merkur2k

  • Addicted
  • *
  • Posts: 513
    • View Profile
Re: MySQL failure. Any advice?
« Reply #1 on: October 27, 2011, 06:52:25 am »
that seems pretty serious if its just segfaulting and dumping core. sure theres not any useful error messages in its logs before it does that?
might be some filesystem corruption too, it would be a good idea to boot it from a usb stick or livecd and do a full fsck.
if the db is toast though, thats very central to the system and really would require a reinstall.

Marie.O

  • Administrator
  • LinuxMCE God
  • *****
  • Posts: 3676
  • Wastes Life On LinuxMCE Since 2007
    • View Profile
    • My Home
Re: MySQL failure. Any advice?
« Reply #2 on: October 27, 2011, 12:17:17 pm »
another option is to
Code: [Select]
mysql -e "DROP DATABASE pluto_main"
apt-get install --reinstall pluto-system-database
mysql -e "DROP DATABASE pluto_media"
apt-get install --reinstall pluto-media-database

followed by a restore of your latest backup you did from within Web Admin. Follow that with a reboot, and you should be good to go again.

darrenmason

  • Addicted
  • *
  • Posts: 529
    • View Profile
Re: MySQL failure. Any advice?
« Reply #3 on: November 01, 2011, 02:43:01 am »
Thanks for the suggestions guys. Thought I would come back with an update....

fsck - was clean
posde - your suggestions rely on mysqld running which it isn't - but I may need those as the next step anyway.

The failure seems to be on applying the binlog when attempting to recover from a crash. The system was obviously left in this state from the power failing. It seemed to be stuck trying to apply the logs. Tried lots of different command line options to mysqld and running through debugger etc but nothing really worked.

At the last minute last night I thought I might just remove the binlog files so that it can't  apply them. This worked to an extent - in that it now allows mysqld to start. It has quite a lot of DB errors now with things being out of sync and missing which I figure is a side effect of removing the files. Went to bed after that as I couldn't keep my eyes open.

Will now try putting the binlog files back to see what happens. If it is still not happy then will follow posde suggestion and re-install the DB's.

Regards
Darren