zabbix切换数据库思路
zabbix切换数据库操作
1、安装mysql-server数据库 ,将三个表结构复制过去
将schema.sql p_w_picpaths.sql data.sql 数据库从zabbix服务器上复制到/root路径下面
然后导入表结构
[root@mysql-server ~]# /usr/bin/mysql -uzabbix -pzabbix zabbix < /root/schema.sql
Warning: Using a password on the command line interface can be insecure.
[root@mysql-server ~]# /usr/bin/mysql -uzabbix -pzabbix zabbix < /root/p_w_picpaths.sql
Warning: Using a password on the command line interface can be insecure.
[root@mysql-server ~]# /usr/bin/mysql -uzabbix -pzabbix zabbix < /root/data.sql
Warning: Using a password on the command line interface can be insecure.
2、修改zabbix_server.conf 中 注意这边是下划线
[root@zabbix01 ~]# find / -name 'zabbix_server.conf'
/etc/zabbix/zabbix_server.conf
LogFile=/var/log/zabbix/zabbix_server.log
DBName=zabbix
DBUser=zabbix
DBPassword=zabbix
3、修改zabbix-server.php
[root@Zabbix02 ~]# vi /var/www/html/zabbix/conf/zabbix.conf.php
注意检查表红色的地方
// Zabbix GUI configuration file.
global $DB;
$DB['TYPE'] = 'MYSQL';
$DB['SERVER'] = '10.7.10.56';
$DB['PORT'] = '3306';
$DB['DATABASE'] = 'zabbix';
$DB['USER'] = 'zabbix';
$DB['PASSWORD'] = 'zabbix';