(01)
systemctl disable --now firewalld
sed -i s/SELINUX=enforcing/SELINUX=disabled/ /etc/selinux/config
(02)
rpm -Uvh https://repo.zabbix.com/zabbix/6.0/rhel/8/x86_64/zabbix-release-latest.el8.noarch.rpm
(03)
dnf clean all
dnf install zabbix-server-mysql zabbix-web-mysql zabbix-apache-conf zabbix-sql-scripts zabbix-selinux-policy zabbix-agent
(04)
wget https://repo.mysql.com//mysql80-community-release-el7-1.noarch.rpm
rpm -ivh mysql80-community-release-el7-1.noarch.rpm
yum install mysql-server
vi /etc/my.cnf
[mysqld]
lower_case_table_names=1
(05)
systemctl start mysqld.service
systemctl status mysqld.service
systemctl enable mysqld.service
(06)
more /var/log/mysql/mysqld.log
mysql -uroot
alter user ‘root’@‘localhost’ identified by ‘password’;
use mysql;
select host from user where user=‘root’;
update user set host=‘%’ where user = ‘root’ and host=‘localhost’;
select host from user where user=‘root’;
flush privileges;
(07)
mysql -uroot -ppassword
create database zabbix character set utf8mb4 collate utf8mb4_bin;
create user zabbix@localhost identified by ‘password’;
grant all privileges on zabbix.* to zabbix@localhost;
quit;
(08)
zcat /usr/share/zabbix-sql-scripts/mysql/server.sql.gz | mysql -uzabbix -p
【错误】ERROR 1046 (3D000) at line 1: No database selected
cd /usr/share/zabbix-sql-scripts/mysql/
cp server.sql.gz server.sql.gz.xzfbak
gunzip server.sql.gz
yum -y install nano
nano server.sql
【第一行添加】
use zabbix;
cat server.sql | mysql -uroot -p
(09)
vi /etc/zabbix/zabbix_server.conf
DBPassword=password
(10)
systemctl restart zabbix-server zabbix-agent httpd php-fpm
systemctl enable zabbix-server zabbix-agent httpd php-fpm
netstat -lntp
(11)
http://IP/zabbix登陆zabbix,用户名Admin,密码zabbix