How to install MySQL 8.0.17 and configure remote access

How to install MySQL 8.0.17 and configure remote access

1. Preparation before installation

Check the database version command: mysql --version

mysql-community-common-8.0.17-1.el7.x86_64.rpm
mysql-community-libs-8.0.17-1.el7.x86_64.rpm
mysql-community-client-8.0.17-1.el7.x86_64.rpm
mysql-community-server-8.0.17-1.el7.x86_64.rpm

2. Install the RPM package

Install the above RPM packages in sequence. The previous and next installation packages are dependent on each other.

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

3. Query the initial password of the root account

The initial password of MySQL version 8.0 is not empty by default. It is automatically generated during installation and stored in /var/log/mysqld.logzhon .

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

4. Change the root password

There are default security requirements for changing passwords, and there are controls on password complexity.

mysql> alter user 'root'@'localhost' identified by 'redhat';
ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
mysql> alter user 'root'@'localhost' identified by '1qaz!QAZ';
Query OK, 0 rows affected (0.15 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.01 sec)

5. View current user configuration information

mysql> show databases;
mysql> use mysql;
mysql> select user,host,plugin from user;

6. Create a new user for remote access

mysql> create user 'wangwang'@'%' identified by '1qaz!QAZ';
Query OK, 0 rows affected (0.08 sec)
mysql> grant all on *.* to 'wangwang'@'%';
Query OK, 0 rows affected (0.12 sec)
mysql> select user,host,plugin from user;

The plugin encryption method for this account is caching_sha2_password. When a client running before MySQL 8.0 connects to a MySQL 8.0 server, an error message stating that Authentication plugin 'caching_sha2_password' cannot be loaded will appear (it needs to be changed to mysql_native_password).

7. Modify the encryption method

Modify encryption rules

mysql> alter user 'wangwang'@'%' identified by '1qaz!QAZ' password expire never; 
Query OK, 0 rows affected (0.17 sec)

Update User Password

mysql> alter user 'wangwang'@'%' identified with mysql_native_password by '1qaz!QAZ';
Query OK, 0 rows affected (0.04 sec)

Save changes

mysql> flush privileges;
Query OK, 0 rows affected (0.05 sec)

Query information

mysql> select user,host,plugin from user; 

8. Test the connection

You can use Navicat to test it.

Summarize

The above is the method I introduced to you to install MySQL 8.0.17 and configure remote access. I hope it will be helpful to you. If you have any questions, please leave me a message and I will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website!
If you find this article helpful, please feel free to reprint it and please indicate the source. Thank you!

You may also be interested in:
  • How to enable remote access rights for MySQL database (two methods)
  • How to add remote access permissions to Mysql
  • The Ultimate Method for MySQL Remote Access Settings
  • Multiple methods of setting up remote access to the mysql database
  • Summary of how to set remote access permissions for MySQL database
  • How to enable remote access permissions in MYSQL

<<:  js learning notes: class, super and extends keywords

>>:  In IIS 7.5, HTML supports the include function like SHTML (add module mapping)

Recommend

MySQL Optimization Solution Reference

Problems that may arise from optimization Optimiz...

Javascript to achieve the effect of closing advertisements

Here is a case study on how to close ads using Ja...

Markup Language - Title

Click here to return to the 123WORDPRESS.COM HTML ...

DOCTYPE type detailed introduction

<br />We usually declare DOCTYPE in HTML in ...

Three uses and differences of MySQL not equal

Judgment symbols are often used in MySQL, and not...

Detailed tutorial on installing MYSQL under WINDOWS

1. Download the installation package -Choose the ...

MySQL 8.0.11 Installation Tutorial under Windows

This article records the installation tutorial of...

Vue uses mockjs to generate simulated data case details

Table of contents Install mockjs in your project ...

js uses the reduce method to make your code more elegant

Preface In actual projects, the most common proce...

Windows system mysql5.7.18 installation graphic tutorial

MySQL installation tutorial for Windows system do...

InnoDB engine redo file maintenance method

If you want to adjust the size and number of Inno...

How to view available network interfaces in Linux

Preface The most common task after we install a L...

React sample code to implement automatic browser refresh

Table of contents What is front-end routing? How ...

Hadoop 2.x vs 3.x 22-point comparison, Hadoop 3.x improvements over 2.x

Question Guide 1. How does Hadoop 3.x tolerate fa...

Implementation of VUE infinite level tree data structure display

Table of contents Component recursive call Using ...