1.获取MySQL rpm配置文件
wget http://dev.mysql.com/get/mysql80-community-release-el7-3.noarch.rpm
2.安装 rpm配置文件
rpm -ivh mysql80-community-release-el7-3.noarch.rpm
3.修改enable=1为想要的MySQL版本,不想安装的enable=0
cd /etc/yum.repos.d/
vim mysql-community.repo
4.禁用自带的mysql模组
yum module disable mysql
5.yum自动安装
yum -y install mysql-community-server
6.启动MySQL服务,显示绿色的running即可
service mysqld start
service mysqld status
7.获取MySQL自动安装的初始密码
grep 'temporary password' /var/log/mysqld.log
8.降低密码设置要求等级
set global validate_password_policy=0;
set global validate_password_length=1;
9.设置MySQL密码
ALTER USER 'root'@'localhost' IDENTIFIED BY '123qwe';
10.配置远程机IP登录
GRANT ALL PRIVILEGES ON . TO 'root'@'%' IDENTIFIED BY '123qwe' WITH GRANT OPTION;
FLUSH PRIVILEGES;
11.Navicat远程登录3306接口即可,点击用户--新建用户--输入信息,将服务器权限按需要打开,其他默认即可。