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

JS implements simple calendar effect

This article shares the specific code of JS to ac...

Vue implements interface sliding effect

This article example shares the specific code of ...

In-depth understanding of Vue transition and animation

1. When inserting, updating, or removing DOM elem...

Vue implements multiple selections in the bottom pop-up window

This article example shares the specific code of ...

Vue implements a search box with a magnifying glass

This article shares with you how to use Vue to im...

Causes and solutions for MySQL master-slave synchronization delay

For historical reasons, MySQL replication is base...

Setting up a proxy server using nginx

Nginx can use its reverse proxy function to imple...

Detailed explanation of MySQL slow queries

Query mysql operation information show status -- ...

javascript input image upload and preview, FileReader preview image

FileReader is an important API for front-end file...

Solve the group by query problem after upgrading Mysql to 5.7

Find the problem After upgrading MySQL to MySQL 5...

MySQL column to row conversion tips (share)

Preface: Because many business tables use design ...

Ubuntu 16.04 mysql5.7.17 open remote port 3306

Enable remote access to MySQL By default, MySQL u...

MySql implements page query function

First of all, we need to make it clear why we use...

MySQL green decompression version installation and configuration steps

Steps: 1. Install MySQL database 1. Download the ...