How To Change Zabbix Database Name4 min read
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.
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.
- How To Install Jitsi Own Server For Video Conference On Ubuntu 20.04 - November 16, 2020
- Private Cloud Setup Step By Step Using Apache Cloud Stack - September 19, 2020
- How To Install Zabbix 5.0 On Centos 8 - September 13, 2020
We really appreciate for your support for buying me a coffee.
It takes us a while to compose and upload new content, as they have to be checked to see if Properly works. We appreciate you if you help me for one cup of coffee to keep us awake and always deliver good quality content.
No contribution is small of an amount. We are grateful for any amount you support us with. Thank you!