安装mysql8.0
wget https://dev.mysql.com/get/mysql80-community-release-el8-1.noarch.rpm ##下载mysql80包
yum install mysql80-community-release-el8-1.noarch.rpm ##安装mysql80包
查看mysql源是否安装成功:yum repolist enabled | grep "mysql.*-community.*"
修改yum源,可不配置
配置yum源:cat /etc/yum.repos.d/mysql-community.repo
禁用CentOS8自带的mysql模块
yum module disable mysql
yum install mysql-community-server 安装mysql80
启动mysql
systemctl start mysqld
systemctl enable mysqld
systemctl status mysqld
进入mysql
mysql -uroot -p ##密码在/var/log//var/log/mysqld.log
ALTER USER 'root'@'localhost' IDENTIFIED BY 'Root_21root'; ##修改默认密码
修改密码长度:set global validate_password.length=1;(长度)
修改密码等级:set global validate_password.policy=0;(等级)
安装zabbix6.0
安装zabbix库
rpm -Uvh https://repo.zabbix.com/zabbix/6.0/rhel/8/x86_64/zabbix-release-6.0-1.el8.noarch.rpm
dnf clean all
安装zabbix服务,前端,客户端
dnf install zabbix-server-mysql zabbix-web-mysql zabbix-apache-conf zabbix-sql-scripts zabbix-selinux-policy zabbix-agent
创建zabbix用户
mysql -uroot -p
password
mysql> create database zabbix character set utf8mb4 collate utf8mb4_bin;
mysql> create user zabbix@localhost identified by 'password';
mysql> grant all privileges on zabbix.* to zabbix@localhost;
mysql> quit;
导入初始配置
zcat /usr/share/doc/zabbix-sql-scripts/mysql/server.sql.gz | mysql -uzabbix -p zabbix
修改zabbix服务配置文件
vi /etc/zabbix/zabbix_server.conf
DBPassword=password
systemctl restart zabbix-server zabbix-agent httpd php-fpm ##启动
systemctl enable zabbix-server zabbix-agent httpd php-fpm ##开机自启动
The server requested authentication method unknown to the client ##连接数据库提示!
解决办法:
1.删除创建的用户和授权,
找到mysql配置文件并加入
default_authentication_plugin=mysql_native_password
变为原来的验证方式,然后从新创建用户并授权即可
2.
mysql -uroot -p
use mysql;
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '你的密码';
设置中文
[root@vm2 ~]# dnf install langpacks-zh_CN.noarch
# 安装zh_CN语言包
[root@vm2 ~]# dnf -y install glibc-common
# 安装glibc-common实现对语言包的识别
[root@vm2 ~]# locale -a | grep zh_CN
zh_CN
zh_CN.gb18030
zh_CN.gbk
zh_CN.utf8
# 安装成功
中文乱码
将windows的楷体拖到/usr/share/zabbix/assets/fonts中,如果字体文件是大写,就改成小写
vim /usr/share/zabbix/include/defines.inc.php
82 define('ZBX_GRAPH_FONT_NAME', 'simkai'); // font file name
127 define('ZBX_FONT_NAME', 'simkai');
将这两行改成字体文件名字(不带后缀名)