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...")
 
 
(One intermediate revision by one other user not shown)
Line 5: Line 5:
 
<h2>Problem:</h2>
 
<h2>Problem:</h2>
  
Database errors found.
+
Found database errors "tables doesn't exist".
  
 
  /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  
 
  /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  
Line 18: Line 18:
 
<h2>Solution:</h2>
 
<h2>Solution:</h2>
  
Drop and reload the mySQL DB to fix the problem :
+
Drop and reload the MySQL database to fix the problem :
 
<pre>
 
<pre>
 
1. zmcontrol stop
 
1. zmcontrol stop
Line 28: Line 28:
 
4. mysql --batch --skip-column-names -e "show databases" | grep -e mbox -e zimbra > /tmp/mysql.db.list; mkdir /tmp/mysql.sql/
 
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 >  
+
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  
  /tmp/mysql.sql/$db.sql; echo "Dumped $db"; sleep 10; done
 
  
 
6. mysql.server stop
 
6. mysql.server stop
Line 52: Line 51:
  
  
"Aarti Shah"
 
  
<ashah@zimbra.com>
+
Submitted by:  Aarti Shah
 
 
ZCS Version - 8.6
 

Latest revision as of 07:06, 21 August 2017

Database errors in ZCS 8.6



Problem:

Found database errors "tables doesn't exist".

/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 database 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



Submitted by: Aarti Shah

Jump to: navigation, search