启动MySQL [root@localhost /]# systemctl restart mariadb [root@localhost /]# systemctl enable mariadb.service MariaDB [(none)]> set password=password(‘123456‘) 创建相关数据库、用户并授权 先查看配置文件里用的什么用户、什么数据库 [root@localhost /]# cd /etc/zabbix/ [root@localhost zabbix]# vim zabbix_server.conf
DBHost指数据库软件安装位置
DBName指数据库名字
DBPassword数据库密码 保存并授权 MariaDB [(none)]> grant all on zabbix.* to zabbix@‘localhost‘ identified by ‘zabbix‘; Query OK, 0 rows affected (0.00 sec) MariaDB [(none)]> create datebase zabbix;
填充数据 [root@localhost zabbix]# cd /usr/share/doc/zabbix- zabbix-2.4.5/ zabbix-server-mysql-2.4.5/ zabbix-agent-2.4.5/ [root@localhost zabbix]# cd /usr/share/doc/zabbix-server-mysql-2.4.5/ [root@localhost zabbix-server-mysql-2.4.5]# ls create upgrades [root@localhost zabbix-server-mysql-2.4.5]# cd create/ 将这里边的数据导入到数据库 [root@localhost create]# mysql -uzabbix -pzabbix zabbix [root@localhost create]# mysql -uzabbix -pzabbix zabbix [root@localhost create]# mysql -uzabbix -pzabbix apache进行设置(RHEL7和CentO S7需要设置) [root@localhost conf.d]# systemctl start httpd [root@localhost conf.d]# systemctl enable httpd.service [root@localhost conf.d]# /etc/init.d/zabbix-server start
解决方案 [root@localhost ~]# cd /etc/httpd/conf.d [root@localhost conf.d]# vim zabbix.conf