Get the App
SLTechnology News&Howtos  ›  Database  › 

Install mysql 8.0.17 and configure remote access methods

Shulou Source: shulou.com Published: 2022-06-01 02:15:12 11月13日 Update

First, prepare before installation

View database version command: mysql-- version

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

Second, install RPM package

Install the above RPM package in turn, with a dependency before and after the installation package.

# 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 root account

The initial password for mysql version 8.0 is not empty by default, is automatically generated during installation, and is 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

Change the root password

Changing the password has security requirements by default, and the complexity of the password is controlled.

Mysql > alter user 'root'@'localhost' identified by' redhat';ERROR 1819 (HY000): Your password does not satisfy the current policy requirementsmysql > alter user 'root'@'localhost' identified by' 1qazox QAZThe 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' 1qazoy QAZThe question 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 of the account is caching_sha2_password. Clients before MySQL 8.0 will have an Authentication plugin 'caching_sha2_password' cannot be loaded error when connecting to the MySQL 8.0 server (it should be changed to mysql_native_password).

7. Modify the encryption method

Modify encryption rules

Mysql > alter user 'wangwang'@'%' identified by' 1qazox 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' 1qazure QAZBESTITY 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 for testing.

Summary

The above is the method of installing mysql 8.0.17 and configuring remote access introduced by the editor. I hope it will be helpful to you. If you have any questions, please leave me a message and the editor will reply to you in time. Thank you very much for your support to the website!

If you think this article is helpful to you, you are welcome to reprint it, please indicate the source, thank you!

Tags: Password user encryption configuration information method version account help query test method complexity security provenance command complexity security client client Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Tech Info Xiaomi Huawei macOS MariaDB