purpose
This article describes the following two points:
A. How to install MySQL 8.0
Two. Navicat MySQL connection
A. How to install MySQL 8.0
Mysql installed in two ways:
Download the official source (slower)
https://dev.mysql.com/get/mysql80-community-release-el7-1.noarch.rpm # 下载rpm包
yum localinstall mysql80-community-release-el7-1.noarch.rpm # 处理相关依赖
yum install mysql-community-server # 安装
A source 163, a separate mounting
wget https://mirrors.163.com/mysql/Downloads/MySQL-8.0/mysql-community-common-8.0.18-1.el7.x86_64.rpm
wget https://mirrors.163.com/mysql/Downloads/MySQL-8.0/mysql-community-libs-8.0.18-1.el7.x86_64.rpm
wget https://mirrors.163.com/mysql/Downloads/MySQL-8.0/mysql-community-client-8.0.18-1.el7.x86_64.rpm
wget https://mirrors.163.com/mysql/Downloads/MySQL-8.0/mysql-community-server-8.0.18-1.el7.x86_64.rpm
rpm -ivh mysql-community-common-8.0.18-1.el7.x86_64.rpm # rpm下载
rpm -ivh mysql-community-libs-8.0.18-1.el7.x86_64.rpm
rpm -ivh mysql-community-client-8.0.18-1.el7.x86_64.rpm
rpm -ivh mysql-community-server-8.0.18-1.el7.x86_64.rpm
Mysql restart
service mysqld start
View Mysql default password
cat /var/log/mysqld.log | grep password
log in
mysql -uroot -p # 回车,复制上面的密码即可
Two. Navicat connection Mysql
Before connecting mysql, to modify the root password
set global validate_password.policy=0; #修改策略
set global validate_password.length=1;
alter user 'root'@'localhost' identified with mysql_native_password by '12345678'; # 测试环境,密码可以简单点,Mysql8.0必须用mysql_native_password给账号加密
Can exit to exit, log in again to see.
Changing the root account Host, to facilitate IP connections
use mysql; #mysql的基础表
update user set Host = '%' where User='root'; # 正式环境,可以创建新的Mysql账号,设置成具体的ip
Open port 3306
firewall-cmd --add-port=3306/tcp --permanent
firewall-cmd --reload
The following new connection Navicat, to