Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Install mysql 8.0.17 and configure remote access methods

2025-04-03 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

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!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report