[Linux series] Centos 7 installation of Mysql8.0

Keywords: MySQL RPM Navicat yum

objective

This paper mainly introduces the following two points:

How to install Mysql8.0

2. Navicat to Mysql

How to install Mysql8.0

There are two ways to install Mysql:

Download official source directly (slower)

https://dev.mysql.com/get/mysql80-community-release-el7-1.noarch.rpm download RPM package
yum localinstall mysql80-community-release-el7-1.noarch.rpm # Handling related dependencies
yum install mysql-community-server # install

Separate installation with 163 source

wget https://mirrors.163.com/mysql/Downloads/MySQL-8.0/mysql-community-common-8.0.13-1.el7.x86_64.rpm
wget https://mirrors.163.com/mysql/Downloads/MySQL-8.0/mysql-community-libs-8.0.13-1.el7.x86_64.rpm
wget https://mirrors.163.com/mysql/Downloads/MySQL-8.0/mysql-community-client-8.0.13-1.el7.x86_64.rpm
wget https://mirrors.163.com/mysql/Downloads/MySQL-8.0/mysql-community-server-8.0.13-1.el7.x86_64.rpm

rpm -ivh mysql-community-common-8.0.13-1.el7.x86_64.rpm  # rpm Download
rpm -ivh mysql-community-libs-8.0.13-1.el7.x86_64.rpm
rpm -ivh mysql-community-client-8.0.13-1.el7.x86_64.rpm
rpm -ivh mysql-community-server-8.0.13-1.el7.x86_64.rpm

Restart Mysql

service mysqld start

View Mysql default password

cat /var/log/mysqld.log | grep password

Sign in

mysql -uroot -p # Enter, copy the above password
2. Navicat to Mysql

Before connecting to mysql, change the password of root

set global validate_password.policy=0; #Modification strategy
set global validate_password.length=1; 
alter user 'root'@'localhost' identified with mysql_native_password by '12345678'; # In the test environment, the password can be simple. Mysql8.0 must use MySQL native password to encrypt the account

You can exit and log in again.

Modify the Host of root account to facilitate IP connection

use mysql; #Basic table of mysql
update user set Host = '%' where User='root'; # In the formal environment, you can create a new Mysql account and set it to a specific ip address

Open 3306 port

firewall-cmd --add-port=3306/tcp --permanent
firewall-cmd --reload

Next, use Navicat to create a new connection

Posted by blear on Mon, 25 Nov 2019 09:05:02 -0800