由于zabbix每天收集大量记录,清理过期的数据以提高查询性能。
mysql -uroot -p 输入mysql密码
use zabbix;
-----------------------------------------------------------------------
truncate table history;
optimize table history;
-----------------------------------------------------------------------
truncate table history_str;
optimize table history_str;
-----------------------------------------------------------------------
truncate table history_uint;
optimize table history_uint;
-----------------------------------------------------------------------
truncate table trends;
optimize table trends;
-----------------------------------------------------------------------
truncate table trends_uint;
optimize table trends_uint
-----------------------------------------------------------------------
Mysql中如果表和表之间建立的外键约束,则无法删除表及修改表结构
-----------------------------------------------------------------------
optimize table events;