2017年5月26日 星期五

修復 Cacti Server 的 MySQL 資料庫


剛建立cacti時,本來都可以正常畫圖,後來我也不知道我幹了什麼事,DB就壞了,翻log就看到這段錯誤
2017-05-24 16:55:31 603 [ERROR] /usr/sbin/mysqld: Table './cacti/graph_template_input_defs' is marked as crashed and should be repaired
2017-05-24 16:55:31 603 [Warning] Checking table:   './cacti/graph_template_input_defs'
2017-05-24 16:55:31 603 [ERROR] /usr/sbin/mysqld: Table './cacti/host_template_graph' is marked as crashed and should be repaired
2017-05-24 16:55:31 603 [Warning] Checking table:   './cacti/host_template_graph'
2017-05-24 16:55:31 603 [ERROR] /usr/sbin/mysqld: Table './cacti/host_template_snmp_query' is marked as crashed and should be repaired
2017-05-24 16:55:31 603 [Warning] Checking table:   './cacti/host_template_snmp_query'
2017-05-24 16:55:31 603 [ERROR] /usr/sbin/mysqld: Table './cacti/plugin_db_changes' is marked as crashed and should be repaired
2017-05-24 16:55:31 603 [Warning] Checking table:   './cacti/plugin_db_changes'
2017-05-24 16:55:31 603 [ERROR] /usr/sbin/mysqld: Table './cacti/weathermap_groups' is marked as crashed and should be repaired
2017-05-24 16:55:31 603 [Warning] Checking table:   './cacti/weathermap_groups'
解法:
第一種: php /usr/share/cacti/cli/repair_database.php (我沒用)
第二種: mysqlcheck -c -u root -p --all-databases
這樣它就好了。
Reference: 

沒有留言:

張貼留言