首先按https://www.zabbix.com/documentation/4.2/manual/installation/install_from_packages/rhel_centos
官网页面安装好zabbix 我这里安装的4.2.0版本的
[root@test132 ~]#rpm -Uvh https://repo.zabbix.com/zabbix/4.2/rhel/7/x86_64/zabbix-release-4.2-2.el7.noarch.rpm
[root@test132 ~]#yum-config-manager --enable rhel-7-server-optional-rpms
[root@test132 ~]#yum install -y zabbix-server-mysql zabbix-web-mysql httpd zabbix-agent
[root@test132 ~]#mysql -uroot -p #进入数据库创建zabbix账号
password
mysql> create database zabbix character set utf8 collate utf8_bin;
mysql> create user zabbix@localhost identified by ‘password’;
mysql> grant all privileges on zabbix.* to zabbix@localhost;
mysql> quit;
导入初始架构和数据,系统将提示您输入新创建的密码
[root@test132 ~]#zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p zabbix
编辑配置文件 /etc/zabbix/zabbix_server.conf
DBPasswor