远程机器安装数据库(此处为mariadb)
yum install mariadb mariadb-server -y
重启并加入开机自启
systemctl restart mariadb.service
systemctl enable mariadb.service
创建zabbix库及远程连接的用户
mysql -uroot -e "create database zabbix character set utf8 collate utf8_bin;"
mysql -uroot -e "grant all privileges on zabbix.* to zabbix@'%' identified by 'zabbix';"
在原数据库导出数据并导入至新数据库
mysqldump -B zabbix >zabbix.sql
cat zabbix.sql | mysql -h 172.16.1.51 -uzabbix -pzabbix zabbix
修改zabbix-server的数据库指向
vim /etc/zabbix/zabbix_server.conf
DBHost=172.16.1.63
DBName=zabbix
DBUser=zabbix
DBPassword=zabbix
修改zabbix-web的指向
vim /etc/zabbix/web/zabbix.conf.php
$DB['SERVER'] = '172.16.1.63';
重启zabbix-server和httpd
systemctl restart zabbix-server httpd
刷新页面看能否正常登陆