rpm -Uvh http://repo.mysql.com/mysql57-community-release-el7-8.noarch.rpm
安装mysqlyum install mysql-community-server
运行mysqldsystemctl start mysqld
查看mysqld的运行状态和一些初始化的提示 systemctl status mysqld查看初始密码
grep "password" /var/log/mysqld.log
连接mysql mysql -uroot -pgYRxfWRlv5+i2018-08-15T06:46:46.786449Z 1 [Note] A temporary password is generated for root@localhost: gYRxfWRlv5+i
这时候不能做其他操作,需要先设置我们自己的密码 SET PASSWORD = PASSWORD('');
授权远程访问
grant all privileges on . to root@"%" identified by "";
flush priviledges;
服务器必须打开3306端口访问才可以