(1)用root账号登录到linux服务器
(2)cd /usr/local
(3)mkdir soft
(4)cd soft
(5)下载安装用的yum repository
wget -i -c http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm
(6)yum -y install mysql57-community-release-el7-10.noarch.rpm
(7)开始安装mysql服务器
yum -y install mysql-community-server
(8)启动服务
systemctl start mysqld.service
(9)查看状态
systemctl status mysqld.service
(10)查看mysql初始化密码
grep "password" /var/log/mysqld.log
(11)进入数据库
mysql -uroot -p
(12)修改初始密码
ALTER USER 'root'@'localhost' IDENTIFIED BY '指定需要初始化的密码';
(13)开启mysql的远程访问
grant all privileges on *.* to 'root'@'%' identified by '初始化的密码' with grant option;
(14)刷新权限
flush privileges;