How To Change Zabbix Database Name
Zabbix database is very important. If you want to change the Zabbix database name. All the data on the Zabbix server is in its database. So the Zabbix database is very important. Then follow the steps below.
⇒ Install Zabbix server on ubuntu 16.04
⇒ Send Mail Notification From Zabbix Server Using Gmail
⇒ How To Add Windows Host In Zabbix Server
⇒ Install Zabbix Agent Into Windows
⇒ How to Install And Configure Zabbix Agent on Ubuntu
⇒ Monitor mysql Service In My Zabbix Server
⇒ How To Upgrade Zabbix Server From 3.2.6 To 3.4.1
Step #01: First, stop all the Zabbix services and then backup the database.
[email protected]:~# service zabbix-server stop [email protected]:~# service zabbix-agent stop [email protected]:~# service zabbix-java-gateway stop
Step #02: Now back up your running database.
[email protected]:~# mysqldump -u root -p zabbix_old > zabbix_old.sql
Type mysql root password for database backup.
Step #03: Now goto mysql and create new database name command below.
[email protected]:~# mysql -u root -p
Type mysql root password.
Create new database with grant privilege.
mysql> create database zabbix_new character set utf8 collate utf8_bin; mysql> grant all privileges on zabbix_new.* to [email protected] identified by 'passw0rd'; mysql> flush privileges; cd database/mysql mysql -uzabbix_user -ppassw0rd zabbix_new < schema.sql mysql -uzabbix_user -ppassw0rd zabbix_new < images.sql mysql -uzabbix_user -ppassw0rd zabbix_new < data.sql \q
Step #04: The backup Zabbix database will be restored to the new database.
[email protected]:~# mysql -u root -p zabbix_new < zabbix_old.sql
Step #05: Database information is provided in two files. A file is a zabbix_server.conf config file and the other is a web zabbix.conf.php config file.
Now open and change new database information like as database name, database user and database password.
This is web config file.
[email protected]:~# vi /etc/zabbix/web/zabbix.conf.php
Like as example below.
$DB['TYPE'] = 'MYSQL'; $DB['SERVER'] = 'localhost'; $DB['PORT'] = '0'; $DB['DATABASE'] = 'zabbix_new'; $DB['USER'] = 'zabbix_user'; $DB['PASSWORD'] = 'passw0rd';
And other config file.
[email protected]:~# vi /etc/zabbix/zabbix_server.conf
Server config details below
DBName=zabbix_new DBUser=zabbix_user DBPassword=passw0rd
All settings are complete now starting services.
[email protected]:~# service zabbix-server start [email protected]:~# service zabbix-agent start [email protected]:~# service zabbix-java-gateway start
Goto your browser and access via admin login.
Zabbix default user name and password:
User Name : Admin (‘A’ must be use capital)
Password : zabbix ( You can change any time)
If you need, you can see another post.
Leave a Reply