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

Linux Check the installation location of the software simple method

1. Check the software installation path: There is...

How to use React to implement image recognition app

Let me show you the effect picture first. Persona...

Exploring the use of percentage values ​​in the background-position property

How background-position affects the display of ba...

A brief introduction to the command line tool mycli for operating MySQL database

GitHub has all kinds of magic tools. Today I foun...

JavaScript to achieve Taobao product image switching effect

JavaScript clothing album switching effect (simil...

Detailed explanation of common methods of JavaScript Array

Table of contents Methods that do not change the ...

Linux implements automatic and scheduled backup of MySQL database every day

Overview Backup is the basis of disaster recovery...

Navicat connects to MySQL8.0.11 and an error 2059 occurs

mistake The following error occurs when connectin...

MySQL million-level data paging query optimization solution

When there are tens of thousands of records in th...

Vue-cli creates a project and analyzes the project structure

Table of contents 1. Enter a directory and create...

Handwritten Vue2.0 data hijacking example

Table of contents 1: Build webpack 2. Data hijack...