一、CentOS 7 安装mysql 5.7
1、先到清华大学镜像站找到想要安装的mysql版本,我使用的是mysql5.7,复制镜像地址(https://mirrors.tuna.tsinghua.edu.cn/mysql/yum/mysql57-community-el7/mysql57-community-release-el7-10.noarch.rpm)
2、安装
#下载
wget https://mirrors.tuna.tsinghua.edu.cn/mysql/yum/mysql57-community-el7/mysql57-community-release-el7-10.noarch.rpm
#本地安装
yum localinstall mysql57-community-release-el7-10.noarch.rpm -y
# 查看yum repository是否安装成功
yum repolist enabled | grep "mysql.*-community.*"
# 下载mysql server
yum install mysql-community-server
# 启动mysql
systemctl start mysqld
# 查看mysql状态
systemctl status mysqld
# 查看临时生成的密码,会显示临时密码,可以使用临时密码登录,然后修改
grep 'temporary password' /var/log/mys