zabbix切換數據庫思路

zabbix切換數據庫操作

1、安裝mysql-server數據庫 ,將三個表結構複製過去

schema.sql  images.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/images.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

注意檢查表紅色的地方

<?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';


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章