centos 下rpm安装mysql
1、下载wget
# yum -y install wget
2、下载
# wget http://repo.mysql.com/mysql57-community-release-el7-8.noarch.rpm
3、安装
# rpm -ivh mysql57-community-release-el7-8.noarch.rpm
# yum -y install mysql-server --nogpgcheck
4、启动Mysql
# systemctl start mysqld
5、获取安装时的临时密码
# grep 'temporary password' /var/log/mysqld.log
如果 密码读不出来的话 可以看一下https://www.cnblogs.com/yongquan/p/15960894.html
6、.修改密码
# mysql -uroot -p
mysql> set password for root@localhost = password('P@ssw0rd');
如果有问题可以参考更多改密码方式: https://www.cnblogs.com/yongquan/p/15961670.html
14.创建初始数据库
mysql> create database zabbix character set utf8 collate utf8_bin;
mysql> create user zabbix@localhost identified by 'P@ssw0rd';
mysql> grant all privileges on zabbix.* to zabbix@localhost;
mysql> flush privileges;
mysql> quit;