systemctl stop firewalld && systemctl disable firewalld && setenforce 0 && sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config
创建一个脚本
vim test.sh
输入以下内容
#!bin/bash
cd /etc/yum.repos.d/
mkdir backup && mv *repo backup/
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-8.repo
sed -i -e"s|mirrors.cloud.aliyuncs.com|mirrors.aliyun.com|g " /etc/yum.repos.d/CentOS-*
sed -i -e "s|releasever|releasever-stream|g" /etc/yum.repos.d/CentOS-*
yum clean all && yum makecache
保存退出并执行
bash test.sh
从官网找到yum 下载


从网上拉取 yum 配置文件
rpm -Uvh https://dev.mysql.com/get/mysql84-community-release-el8-1.noarch.rpm
禁用原系统的 MySQL 数据包以防冲突
yum module -y disable mysql
检查是否是指定版本
yum repolist all | grep mysql

安装 MySQL 数据库
yum -y install mysql-community-server
启动 MySQL 并设置开机自启动
systemctl restart mysqld.service && systemctl enabled mysqld.service
查看临时密码
grep "temporary password" /var/log/mysqld.log

登录 MySQL
mysql -uroot -p
在后续的输入框中输入临时密码
更新密码
ALTER USER CURRENT_USER() IDENTIFIED BY '你的新密码(需要符合密码校验规则)';
退出即可完成
拉取 Zabbix 服务的配置文件
rpm -Uvh https://repo.zabbix.com/zabbix/7.0/centos/8/x86_64/zabbix-release-7.0-1.el8.noarch.rpm
清理 DNF (Dandified Yum) 包管理器缓存
dnf clean all
切换 PHP 版本为 8.0
dnf module switch-to php:8.0 -y
安装 Zabbix server,Web 前端,agent
dnf install zabbix-server-mysql zabbix-web-mysql zabbix-apache-conf zabbix-sql-scripts zabbix-selinux-policy zabbix-agent -y
在数据库主机上运行以下代码。
mysql -uroot -p
mysql> create database zabbix character set utf8mb4 collate utf8mb4_bin;
mysql> create user zabbix@localhost identified by '要设置的密码';
mysql> grant all privileges on zabbix.* to zabbix@localhost;
mysql> set global log_bin_trust_function_creators = 1;
mysql> quit;
zcat /usr/share/zabbix-sql-scripts/mysql/server.sql.gz | mysql --default-character-set=utf8mb4 -uzabbix -p zabbix
mysql -uroot -p
mysql> set global log_bin_trust_function_creators = 0;
mysql> quit;
echo -e "DBPassword=password \n AllowUnsupportedDBVersions=1" >> /etc/zabbix/zabbix_server.conf
systemctl restart zabbix-server zabbix-agent httpd php-fpm && systemctl enable zabbix-server zabbix-agent httpd php-fpm
IP/zabbix







