在centos 7.6 上安装mysql 5.7
1: 在/etc/yum.repos.d 目录下先下载mysql5.7的yum 源的rpm包:
Wget http://dev.mysql.com/get/mysql57-community-release-el7-8.noarch.rpm

2:在/etc/yum.repos.d 目录下安装yum源:
Rpm –ivh mysql57-community-release-el7-8.noarch.rpm

3:更新yum源:
Yum clean all
Yum makecache
Yum update

4:退到根目录,查找可以安装的mysql 源:
Yum search mysql

5:安装mysql:
Yum install –y mysql mysql-community-server.x86_64
(安装时老是提示faild,no such morror,可以重复第3步,多试几次)

6:更改密码:

        /usr/bin/mysqladmin –u root password ‘1qqqq123.’
        (这适用于mysql 5.7以下版本)