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

Best Practices for MySQL Upgrades

MySQL 5.7 adds many new features, such as: Online...

react-beautiful-dnd implements component drag and drop function

Table of contents 1. Installation 2.APi 3. react-...

Implementation of Docker CPU Limit

1. --cpu=<value> 1) Specify how much availa...

9 ways to show and hide CSS elements

In web page production, displaying and hiding ele...

Share 16 burning flame effect English fonts treasure trove

We live in a visual world and are surrounded by m...

Tutorial on installing mysql5.7.18 on mac os10.12

I searched the entire web and found all kinds of ...

Today I will share some rare but useful JS techniques

1. Back button Use history.back() to create a bro...

Detailed Analysis of the Selection of MySQL Common Index and Unique Index

Suppose a user management system where each perso...

Vue globally introduces scss (mixin)

Table of contents 1. mixin.scss 2. Single file us...

Linux system dual network card binding configuration implementation

System version [root@ ~]# cat /etc/redhat-release...

Complete steps to quickly configure HugePages under Linux system

Preface Regarding HugePages and Oracle database o...