```#wget https://repo.mysql.com//mysql80-community-release-el7-1.noarch.rpm```
#yum localinstall mysql80-community-release-el7-1.noarch.rpm
cd /etc/yum.repos.d/
进入yum源目录
#ls
#vim mysql-community.repo
【建议安装mysql 5.5】
把eabled=0 改为=1 意为默认安装该版本,同时把下面8.0版本的 enabled=1改为=0
#yum install mysql-community-server
#systemctl start mysqld.service
本文选择安装目前最新的zabbix4.4版本,4.4版本相对于老版本更新了更多的新功能。
本文中使用的环境为 zabbix4.4+Centos7.6+mysql_5.5+Apache
# rpm -Uvh https://repo.zabbix.com/zabbix/4.4/rhel/7/x86_64/zabbix-release-4.4-1.el7.noarch.rpm
# yum clean all
# yum install zabbix-server-mysql zabbix-web-mysql zabbix-agent
【注:很多时候因为中国长城防火墙的原因,访问外网网址收部分闲置,zabbix尽享yum安装的时候会报错安装失败等,可以选择使用更换yum源的方式进行解决,参考:https://www.cnblogs.com/liruoxiao/p/12779359.html】
# mysql -uroot -p
password
mysql> create database zabbix character set utf8 collate utf8_bin;
mysql> grant all privileges on zabbix.* to zabbix@localhost identified by ‘password‘;
mysql> quit;
导入初始架构和数据,系统将提示您输入新创建的密码。
# zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p zabbix
编辑配置文件 /etc/zabbix/zabbix_server.conf
在配置文件中增加 DBPassword=password
#vim /etc/zabbix/zabbix_server.conf
辑配置文件 /etc/httpd/conf.d/zabbix.conf 修改时区为中国时区
#vim /etc/httpd/conf.d/zabbix.conf
启动Zabbix server和agent进程,并为它们设置开机自启:
# systemctl restart zabbix-server zabbix-agent httpd
# systemctl enable zabbix-server zabbix-agent httpd
sudo systemctl enable httpd
sudo systemctl start httpd
systemctl stop firewalld.service
开启80端口
# firewall-cmd --zone=public --add-port=80/tcp --permanent
# firewall-cmd --reload
http://server_ip_or_name/zabbix
完成!
原文:https://www.cnblogs.com/liruoxiao/p/12778646.html