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

MySQL 8.0.13 download and installation tutorial with pictures and text

MySQL is the most commonly used database. You mus...

Vue realizes adding watermark to uploaded pictures (upgraded version)

The vue project implements an upgraded version of...

vite2.x implements on-demand loading of ant-design-vue@next components

1. Use version vite:2.0 ant-design-vue: 2.0.0-rc....

UCenter Home site adds statistics code

UCenter Home is an SNS website building system rel...

Summarize some general principles of web design and production

<br />Related articles: 9 practical suggesti...

Notes on using the blockquote tag

<br />Semanticization cannot be explained in...

Tutorial on installing nginx in Linux environment

Table of contents 1. Install the required environ...

Introduction and usage of Angular pipeline PIPE

Preface PIPE, translated as pipeline. Angular pip...

Nginx access control and parameter tuning methods

Nginx global variables There are many global vari...

Boundary and range description of between in mysql

mysql between boundary range The range of between...

A brief discussion on Flex layout and scaling calculation

1. Introduction to Flex Layout Flex is the abbrev...

Comparison of various ways to measure the performance of JavaScript functions

Table of contents Overview Performance.now Consol...

JS implementation of Apple calculator

This article example shares the specific code of ...

Exploring the practical value of the CSS property *-gradient

Let me first introduce an interesting property - ...