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

How to install Mysql5.7 and change the initial password for Centos7

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

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

This article mainly explains "how to install Mysql5.7 and change the initial password in Centos7". Interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how to install Mysql5.7 and change the initial password in Centos7.

1. Official installation documentation

Http://dev.mysql.com/doc/mysql-yum-repo-quick-guide/en/

2. Download the Mysql yum package

Http://dev.mysql.com/downloads/repo/yum/

Download it locally and upload it to the server, or download it directly using wget

Wget http://repo.mysql.com/mysql57-community-release-el7-10.noarch.rpm

3. Transfer software source

Replace platform-and-version-specific-package-name with the name of the rpm you downloaded

Sudo rpm-Uvh platform-and-version-specific-package-name.rpm

For example

Rpm-Uvh mysql57-community-release-el7-10.noarch.rpm

The password here is YdsGaxOq > 2n!

7.2 Log in and change your password

Log in with the default password

Mysql-uroot-p

After logging in to the server with this password, you must change the password immediately, otherwise the following error will be reported:

Mysql > select @ @ log_error

ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.

Mysql >

Modify the password

ALTER USER 'root'@'localhost' IDENTIFIED BY' root123'

If the password setting is too simple, the following prompt appears

How to solve ERROR 1819 (HY000): Your password does not satisfy the current policy requirements? The solution is provided directly here, which is explained in detail at the end of the article.

Two global parameters must be modified:

First, modify the value of the validate_password_policy parameter

Mysql > set global validate_password_policy=0

Then change the length of the password

Set global validate_password_length=1

Just change the password again.

ALTER USER 'root'@'localhost' IDENTIFIED BY' root123';8, authorize other machines to log in

GRANT ALL PRIVILEGES ON *. * TO 'root'@'%' IDENTIFIED BY' mypassword' WITH GRANT OPTION

FLUSH PRIVILEGES

9. Detailed instructions on password setting

ERROR 1819 (HY000): Your password does not satisfy the current policy requirements

At this point, I believe you have a deeper understanding of "how to install Mysql5.7 and change the initial password in Centos7". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

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

Internet Technology

Wechat

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

12
Report