vi /etc/selinux/config
//修改为
SELINUX=disabled
// 备份 下载新的替换
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
yum clean all
yum makecache
yum localinstall https://repo.mysql.com//mysql80-community-release-el7-1.noarch.rpm
yum install mysql-community-server -y
yum install perl -y
yum install net-tools -y
mysqld --initialize
chmod -R 777 /var/lib/mysql/*
grep 'temporary password' /var/log/mysqld.log
2019-08-19T06:16:02.663494Z 5 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: 1wprTxF?fkY1
service mysqld start
mysql -uroot -p
mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY '123123';
use mysql;
update user set host = '%' where user ='root';
flush privileges;
//退出数据库, 修改 mysql 配置文件
vi /etc/my.cnf
[mysqld]
character-set-server=utf8
bind-address=0.0.0.0
firewall-cmd --zone=public --add-port=3306/tcp --permanent
firewall-cmd --reload