Page 1 of 1

MySQL recovery

Posted: Wed Nov 24, 2010 8:44 am
by hodd
So I upgraded one of my MTA's this morning to 6.0.9, and for some reason the upgrade was getting stuck on Starting Mysql. Everything I've read points to a corrupt database.
Everything I found points to the Mysql Crash Recovery
When I get to this step:

mysql --batch --skip-column-names -e "show databases" | grep -e mbox -e zimbra > /tmp/mysql.db.list
I get the error below:

[ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist


I've got a call into support with a server down, but just wanted to reachout to the forums to see if anyone can help as well...

MySQL recovery

Posted: Wed Nov 24, 2010 9:02 am
by phoenix
It really depends on what your exact problem is, there's a couple of threads marked as 'Solved' here: site:zimbra.com +"Fatal error: Can't open and lock privilege tables: Table 'mysql.host'" - Yahoo! Search Results

MySQL recovery

Posted: Wed Nov 24, 2010 9:17 am
by FritzBrause
If your MySQL Server is not starting you may try to repair the table by


/opt/zimbra/mysql/bin/myisamchk -r /opt/zimbra/db/data/mysql/*.MYI


This can fix almost anything on an MyISAM table.

MySQL recovery

Posted: Tue Nov 30, 2010 2:38 pm
by hodd
So it turned out that I accidently rm -rf'd the SQL logs...it's was all bad. Even though I ctrl+c'd very quickly when I saw what I had typed, I had to work with support on rebuilding the mysql tables.

MySQL recovery

Posted: Fri Aug 16, 2013 5:13 am
by malayo
how it was done? zmsetup.pl and choose to only install mysql?

MySQL recovery

Posted: Fri Aug 16, 2013 6:08 am
by FritzBrause
[quote user="malayo"]how it was done? zmsetup.pl and choose to only install mysql?[/QUOTE]
... that will be not necessary in most cases. If you only deleted the InnoDB transaction logs


/opt/zimbra/db/data/ib_logfile0

/opt/zimbra/db/data/ib_logfile1


than stopping Zimbra via "zmcontrol stop" is. O.K. As second step only start and stop the Database (as the zimbra user)


mysql.server start

mysql

mysql> show innidb statusG

mysql> quit

mysql.server stop

zmcontrol start


if nothing else is corrupted, restarting the MySQL Server will recreate the InnoDB transaction logs. If this doesn't lead to success, there's something else.

MySQL recovery

Posted: Fri Aug 16, 2013 9:16 am
by malayo
thanks, apparently my problem of mysql.server and mailboxd would not stated as running was causing by not using right mysql password after copying localconfig.xml from old server for migration purposes (centos 5 to centos 6 because zcs 8 only runs on centos 6)