A quick solution to the first login failure in mysql5.7.20

A quick solution to the first login failure in mysql5.7.20

First, we will introduce how

(1) MySQL 5.7 has a default password

Find the default password

grep 'temporary password' /var/log/mysqld.log 

(2) First login

mysql -uroot -p

(3) Please note that you must change the password after entering for the first time, otherwise you will not be able to operate, otherwise an error will be reported

There is a default password strength for changing passwords: 1. At least 8 characters 2. Contains uppercase and lowercase letters 3. Must contain punctuation marks

(4) Change password and exit (pay attention to password requirements)


(5) You can log in again with the new password to view and perform other operations. If you think the password is too complex, you can modify the password strength.

View password rules: SHOW VARIABLES LIKE 'validate_password%';

(6) Explain the meaning of the above table

1. validate_password_check_user_name Whether to compare the password with the username portion of a valid user account for the current session and reject it if they match. By default, is disabled. This variable controls username matching independent of the value of validate_password_policy. (No changes required)

2. validate_password_dictionary_file specifies the file path for password verification

3. validate_password_length The minimum length of the password (can only be set to 4 at least)

4. validate_password_mixed_case_count The minimum number of lowercase letters and uppercase letters that the password must contain

5. validate_password_number_count The minimum number of numbers that the password must contain

6. validate_password_policy password strength level

Note: LOW (0): only check the length

MEDIUM (1): Check length, numbers, uppercase and lowercase letters, and number of special characters

STRONG (2): Check length, numbers, uppercase and lowercase letters, number of special characters, dictionary file

7. validate_password_special_char_count The minimum number of special characters that the password must contain

(7) Whether creating a user or changing a password, an error will be reported if the password does not meet the rules

(8) Set password strength

set global validate_password_policy=0;
set global validate_password_length=4; 

View password strength specifications: SHOW VARIABLES LIKE 'validate_password%';

(9) Now when you create a user, you only need to use 4 characters to change the password, which is not that complicated.

Summarize

The above is a quick solution to the first login failure of MySQL 5.7.20 introduced by the editor. I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website!

You may also be interested in:
  • Solution to the root password login problem in MySQL 5.7
  • How to install the green version of MySQL Community Server 5.7.16 and implement remote login
  • Solve the problem of ERROR 1045 (28000): Access denied for user ''root''@''localhost'' when logging in after installing MySQL 5.7.17 on Ubuntu 16.04
  • Tutorial on logging into MySQL after installing Mysql 5.7.17
  • Solve the problem of being unable to log in after installing MySQL 5.7 without a data folder
  • Solution to the problem of Access denied for user'root'@'localhost' (using password: YES) in MySQL 8.0 login under win10

<<:  Vue implements setting multiple countdowns at the same time

>>:  centos 7 modify sshd | prohibit root login and sshd port script definition

Recommend

Install Windows Server 2019 on VMware Workstation (Graphic Tutorial)

If prompted to enter a key, select [I don’t have ...

Vue implements the method example of tab routing switching component

Preface This article introduces the use of vue-ro...

The perfect solution for highlighting keywords in HTML

I recently encountered a feature while working on...

XHTML Web Page Tutorial

This article is mainly to let beginners understan...

Detailed explanation of CSS line-height and height

Recently, when I was working on CSS interfaces, I...

Implementation of HTML sliding floating ball menu effect

CSS Styles html,body{ width: 100%; height: 100%; ...

A brief discussion on the maximum number of open files for MySQL system users

What you learn from books is always shallow, and ...

Research on the effect of page sidebar realized by JS

Table of contents Discover: Application of displa...

Mysql date formatting and complex date range query

Table of contents Preface Query usage scenario ca...

Using CSS3 and JavaScript to develop web color picker example code

The web color picker function in this example use...

MySQL 8.0.20 installation and configuration detailed tutorial

This article shares with you a detailed tutorial ...

Detailed explanation of Linux netstat command

Table of contents Linux netstat command 1. Detail...

A brief discussion on the principle of js QR code scanning login

Table of contents The essence of QR code login Un...

MySQL Tutorial: Subquery Example Detailed Explanation

Table of contents 1. What is a subquery? 2. Where...