标签:style 数据库 bin 避免 ext int inno like span
一 历史数据清理
停止相关服务,避免写入数据
/etc/init.d/zabbix-server stop
/etc/init.d/httpd stop
清空历史数据
mysql -uroot -p
use zabbix;
truncate tablehistory;
optimize tablehistory;
truncate tablehistory_uint;
optimize tablehistory_uint;
truncate tabletrends;
optimize tabletrends;
truncate tabletrends_uint;
optimize tabletrends_uint;
二 备份数据库并修改独立表空间
/usr/bin/mysqldump -R -q --all-databases > /temp/all.sql
service mysqldstop
rm -fr /var/lib/mysql/*
vim /etc/my.cnf
在[mysqld]下设置
innodb_file_per_table=1
/usr/bin/mysql_install_db
service mysqldrestart
查看innodb_file_per_table参数是否生效
mysql -uroot -p
mysql> showvariables like ‘%per_table%‘;
+-----------------------+-------+
| Variable_name| Value |
+-----------------------+-------+
|innodb_file_per_table | ON |
+-----------------------+-------+
1 row in set(0.00 sec)
mysql < /tmp/all.sql
三 删除数据库中zabbix原用户并重新配置
Mysql> dropuser zabbix@’localhost’;
Mysql> grantall privileges on zabbix.* to zabbix@’localhost’ identified by ‘zabbix’;
Mysql> flushprivileges;
四 开启zabbix及httpd服务
/etc/init.d/zabbix-server start
/etc/init.d/httpdstart
五 参考资料
http://www.linuxidc.com/Linux/2014-12/110353.htm
http://6034036.blog.51cto.com/6024036/1636779
本文出自 “IT修理工” 博客,请务必保留此出处http://lrtao2010.blog.51cto.com/10425744/1928619
标签:style 数据库 bin 避免 ext int inno like span
原文地址:http://lrtao2010.blog.51cto.com/10425744/1928619