Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

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

Shulou Source: shulou.com Published: 2022-06-02 07:23:34 10月02日 Update

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!

Tags: Password login content parameters learning service practical deeper two global interest again official practical practical easy to operate documentation scheme method more Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MariaDB Apple Xiaomi OPPO Reno vpn