출처 :  http://www.zabbix.com/forum/showthread.php?t=25147



This is a guide for people that normally never work with mysql stuff.

My main problem is that my zabbix InnoDB database get corrupted now and then
(sometimes every month , sometimes less, Running under centos , vmware)
(problem started after a few years of collecting data)


I just wanted to share how to repaired my InnoDB and got my Zabbix up and running again.
(Iam using Centos and webmin installed)


1. service zabbix_server stop

2. Edit /etc/my.cnf
Add this line to the config: innodb_force_recovery = 4

3. service mysqld restart

4. If you don't have webmin installed you can download it from
www.webmin.com or use any other mysql tool.

Backup the databse called zabbix
Example: Successfully backed up 236040666 bytes from database zabbix to file /root/zabbix.sql
!!!Make sure you made a full backup and know where you placed it!!!

5. Edit /etc/my.cnf
Remove the line by adding a # infront of it. #innodb_force_recovery = 4

6. service mysqld restart

7. Enter webmin or any other mysqltool and DROP zabbix database (will remove all data)

8. Create a new database and name it zabbix

9. Enter the new databse named zabbix and perform the command: execute sql file and select the
backup you made in step 4 (/root/zabbix.sql)

This step will take some time if you have lots of data. (2-15 mins)

10. service zabbix_server start

11. done, errors gone, data base is fixed, atleast for me!
Good luck!




+ Recent posts