192.168.40.143 | MySQL8+zabbix6.4+gcc+php |
192.168.40.139 | zabbix6.4-Agent+web |
#关闭防火墙和安全机制
systemctl stop firewalld
systemctl disable firewalld
setenforce 0
sed -i "s/^SELINUX=.*$/SELINUX=disabled/" /etc/selinux/config
一 安装mysql
1、配置Mysql 8.0安装源 mysql官方
rpm -Uvh https://dev.mysql.com/get/mysql80-community-release-el7-6.noarch.rpm
2、安装Mysql 8.0
不安装mysql-devel ,后面编译zabbix会报错:configure: error: MySQL library not found
yum -y --enablerepo=mysql80-community install mysql-community-server mysql-devel --nogpgcheck
3、创建mysql账户
systemctl start mysqld && systemctl enable mysqld && systemctl status mysqld
获取初始密码
cat /var/log/mysqld.log | grep password
登录
mysql -uroot -p
修改root密码实验用的初始密码
ALTER USER 'root'@'localhost' IDENTIFIED BY 'XefvH0KsC@L';
创建一个名为zabbix的数据库
create database zabbix character set utf8 collate utf8_bin;
创建一个名为zabbix的新用户及密码
create user zabbix@localhost identified by 'Zabbix@123';
授予zabbix用户对zabbix数据库的所有权限
grant all pri