一、下载对应系统的MySQL版本,并上传到要安装的服务器上
?
MySQL :: Download MySQL Yum Repository
二、开始安装
- 添加到yum库
- 命令:
yum install mysql80-community-release-el7-3.noarch.rpm  - 查看是否添加成功命令:
yum repolist enabled | grep "mysql.*-community.*" 
- 安装命令:
?yum install mysql-community-server
# 如果出现 Unable to find a match: mysql-community-server 请先禁用本地组件再安装
yum module disable mysql
yum install mysql-community-server
 - 查看是安装目录和版本
 - ?启动MySQL
systemctl start mysqld

?启动成功后需要先生成临时密码登录并修改设置新密码
# 生成 root@localhost 的临时密码
grep 'temporary password' /var/log/mysqld.log

?使用临时密码登录后修改密码

?退出 使用新密码就可以登录了
|