martedì 23 agosto 2011

Zimbra - Error MySql Table upgrade required. Please do "REPAIR TABLE xxx" or dump/reload to fix it!

Have you never seen this error above?
Many thanks to ASWEN for the solution on Zimbra Forum

[zimbra@zimbaba libexec]$ /opt/zimbra/libexec/zmdbintegrityreport
Database errors found.
/opt/zimbra/mysql/bin/mysqlcheck --defaults-file=/opt/zimbra/conf/my.cnf -S /opt/zimbra/db/mysql.sock -A -C -s -u root --password=h9RVTjvYWEYAs2tpZeHWizE.s
...........
mboxgroup1.appointment
error : Table upgrade required. Please do "REPAIR TABLE `appointment`" or dump/reload to fix it!
mboxgroup1.data_source_item
error : Table upgrade required. Please do "REPAIR TABLE `data_source_item`" or dump/reload to fix it!
mboxgroup1.imap_folder
error : Table upgrade required. Please do "REPAIR TABLE `imap_folder`" or dump/reload to fix it!
mboxgroup1.mail_item
error : Table upgrade required. Please do "REPAIR TABLE `mail_item`" or dump/reload to fix it!
mboxgroup1.pop3_message
........
error : Table upgrade required. Please do "REPAIR TABLE `volume`" or dump/reload to fix it!
Run the script to migrate from older version to newest (v.6.x-->v.7.x)
[zimbra@zimbaba libexec]$ /opt/zimbra/libexec/scripts/migrate20100913-Mysql51.pl 
Adding mboxgroup1.mail_item to be optimized
Adding mboxgroup1.appointment to be optimized
Adding mboxgroup1.imap_folder to be optimized
Adding mboxgroup1.imap_message to be optimized
...
Altered 20 mailbox groups in 41 seconds
[zimbra@zimbaba libexec]$ /opt/zimbra/libexec/zmdbintegrityreport
Database errors found.
/opt/zimbra/mysql/bin/mysqlcheck --defaults-file=/opt/zimbra/conf/my.cnf -S /opt/zimbra/db/mysql.sock -A -C -s -u root --password=h9RVTjvYWEYAs2tpZeHWizE.s
mysql.general_log
Error : You can't use locks with log tables.
mysql.slow_log
Error : You can't use locks with log tables.
[zimbra@zimbaba libexec]$ /opt/zimbra/libexec/zmdbintegrityreport --help
Usage: /opt/zimbra/libexec/zmdbintegrityreport [-m] [-v] [-h] [-r]
-m emails report to admin account, otherwise report is presented on stdout
-v verbose output
-r attempt auto repair of tables
-h help
[zimbra@zimbaba libexec]$ /opt/zimbra/libexec/zmdbintegrityreport -r
Database errors found.
/opt/zimbra/mysql/bin/mysqlcheck --defaults-file=/opt/zimbra/conf/my.cnf -S /opt/zimbra/db/mysql.sock -A -C -s -u root --password=h9RVTjvYWEYAs2tpZeHWizE.s --auto-repair
mysql.general_log
Error : You can't use locks with log tables.
mysql.slow_log
Error : You can't use locks with log tables.
This seem to be a MySql bug.....remove the file "general_log.frm" and "slow_log.frm"

[root@zimbaba ]# service zimbra stop
Host zimbaba.testmail.local
Stopping stats...Done.
Stopping mta...Done.
Stopping spell...Done.
Stopping snmp...Done.
Stopping cbpolicyd...Done.
Stopping archiving...Done.
Stopping antivirus...Done.
Stopping antispam...Done.
Stopping imapproxy...Done.
Stopping memcached...Done.
Stopping mailbox...Done.
Stopping logger...Done.
Stopping zmconfigd...Done.
Stopping ldap...Done.
[root@zimbaba ]# cd /opt/zimbra/db/data/mysql

[root@zimbaba mysql]# ls -al *log.frm
-rw-rw---- 1 zimbra zimbra 8776 Mar 13 23:00 general_log.frm
-rw-rw---- 1 zimbra zimbra 8976 Mar 13 23:00 slow_log.frm
[root@zimbaba mysql]# mv *log.frm /tmp/
[root@zimbaba mysql]# ls -al *log.frm
ls: *log.frm: No such file or directory
[root@zimbaba mysql]# service zimbra start
Host zimbaba.testmail.local
Starting ldap...Done.
Starting zmconfigd...Done.
Starting logger...Done.
Starting mailbox...Done.
Starting memcached...Done.
Starting antispam...Done.
Starting antivirus...Done.
Starting snmp...Done.
Starting spell...Done.
Starting mta...Done.
Starting stats...Done.
[root@zimbaba mysql]# su - zimbra
[zimbra@zimbaba ~]$ /opt/zimbra/libexec/zmdbintegrityreport -r
no errors, no warning..
[zimbra@zimbaba ~]$ cd /opt/zimbra/db/data/mysql
[zimbra@zimbaba mysql]$ ls -al *log.frm
ls: *log.frm: No such file or directory
[zimbra@zimbaba mysql]$

Nessun commento:

Posta un commento