Difference between revisions of "Database errors in ZCS 8.6"

(Created page with "===<h1>Database errors in ZCS 8.6</h1>=== <hr> <br> <h2>Problem:</h2> Database errors found. /opt/zimbra/mysql/bin/mysqlcheck --defaults-file=/opt/zimbra/conf/my.cnf -S /o...")
(No difference)

Revision as of 11:51, 14 August 2017

Database errors in ZCS 8.6



Problem:

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=XXXXXXXX 

mysql.gtid_slave_pos
Error    : Table 'mysql.gtid_slave_pos' doesn't exist in engine
mysql.innodb_index_stats
Error    : Table 'mysql.innodb_index_stats' doesn't exist in engine
mysql.innodb_table_stats
Error    : Table 'mysql.innodb_table_stats' doesn't exist in engine

Solution:

Drop and reload the mySQL DB to fix the problem :

1. zmcontrol stop

2. source ~/bin/zmshutil ; zmsetvars

3. mysql.server start

4. mysql --batch --skip-column-names -e "show databases" | grep -e mbox -e zimbra > /tmp/mysql.db.list; mkdir /tmp/mysql.sql/

5. for db in `cat /tmp/mysql.db.list`; do ~/mysql/bin/mysqldump $db -S $mysql_socket -u root --password=$mysql_root_password > 
   /tmp/mysql.sql/$db.sql; echo "Dumped $db"; sleep 10; done

6. mysql.server stop

7. mv /opt/zimba/db/data/ /opt/zimbra/db/dataORIG/

8. /opt/zimbra/libexec/zmmyinit --sql_root_pw $mysql_root_password

9. mysql.server status   **If needed mysql.server start**

10. mysql -e "drop database zimbra"

11. for db in `cat /tmp/mysql.db.list`; do mysql -e "create database $db character set utf8"; echo "Created $db"; done

12. mysql zimbra < /tmp/mysql.sql/zimbra.sql

13. for sql in /tmp/mysql.sql/mbox*; do mysql `basename $sql .sql` < $sql; echo -e "Updated `basename $sql .sql` \n"; done 

14. zmcontrol start


"Aarti Shah"

<ashah@zimbra.com>

ZCS Version - 8.6

Jump to: navigation, search