MySQL recovery

Discuss your pilot or production implementation with other Zimbra admins or our engineers.
hodd
Posts: 43
Joined: Fri Sep 12, 2014 11:35 pm

MySQL recovery

Postby hodd » Wed Nov 24, 2010 8:44 am

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...


phoenix
Ambassador
Ambassador
Posts: 26446
Joined: Fri Sep 12, 2014 9:56 pm
Location: Liverpool, England

MySQL recovery

Postby phoenix » Wed Nov 24, 2010 9:02 am

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
Regards

Bill

Rspamd: A high performance spamassassin replacement

If you'd like to see this implemented in a future version of ZCS then please vote on Bugzilla entries 97706 & 108168
FritzBrause
Advanced member
Advanced member
Posts: 173
Joined: Fri Sep 12, 2014 11:19 pm

MySQL recovery

Postby FritzBrause » Wed Nov 24, 2010 9:17 am

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.
hodd
Posts: 43
Joined: Fri Sep 12, 2014 11:35 pm

MySQL recovery

Postby hodd » Tue Nov 30, 2010 2:38 pm

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.
malayo
Advanced member
Advanced member
Posts: 116
Joined: Sat Sep 13, 2014 1:59 am

MySQL recovery

Postby malayo » Fri Aug 16, 2013 5:13 am

how it was done? zmsetup.pl and choose to only install mysql?
FritzBrause
Advanced member
Advanced member
Posts: 173
Joined: Fri Sep 12, 2014 11:19 pm

MySQL recovery

Postby FritzBrause » Fri Aug 16, 2013 6:08 am

[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.
malayo
Advanced member
Advanced member
Posts: 116
Joined: Sat Sep 13, 2014 1:59 am

MySQL recovery

Postby malayo » Fri Aug 16, 2013 9:16 am

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)

Return to “Administrators”

Who is online

Users browsing this forum: No registered users and 6 guests