The perfect solution for forgetting the password in mysql8.0.19

The perfect solution for forgetting the password in mysql8.0.19

Recommended reading: MySQL 8.0.19 supports account lock function after entering incorrect password three times (example)

1. Open a cmd window (preferably as an administrator), and run net stop mysql to stop the MySQL service.

2. Enable MySQL service that skips password verification

mysqld --console --skip-grant-tables --shared-memory

3. Open a new cmd window and start the mysql service

mysql -u root -p

4. Enter the password and press the space key to skip

5. Leave the password blank

use mysql
update user set authentication_string='' where user='root';
exit

6. Close the MySQL service opened in step 2 (just close the window)

7. Restart the MySQL service and log in without a password

8. Change password

ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '111111';
flush privileges

Adding WITH mysql_native_password can ensure that navicat connection will not have any problems

Summarize

The above is the perfect solution to the problem of forgetting the password of MySQL 8.0.19 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!
If you find this article helpful, please feel free to reprint it and please indicate the source. Thank you!

You may also be interested in:
  • How to reset password after forgetting password in MySQL8 (MySQL old method doesn't work)
  • Solution for forgetting the root password of MySQL5.7 under Windows 8.1
  • A brief analysis of the best way to deal with forgotten MySQL 8 passwords
  • Pitfalls encountered when installing MySQL 8.0.18 compressed package and resetting forgotten passwords
  • mysql8.0 forgotten password modification and net command service name invalid problem
  • Quick solution for forgetting MySQL8 password

<<:  Docker's four network types principle examples

>>:  WeChat applet to save albums and pictures to albums

Recommend

Implementation of a simple login page for WeChat applet (with source code)

Table of contents 1. Picture above 2. User does n...

Detailed tutorial on installing CentOS, JDK and Hadoop on VirtualBox

Table of contents 1. Prerequisites 1.1 Supported ...

Vue implements multiple selections in the bottom pop-up window

This article example shares the specific code of ...

Detailed steps to install web server using Apache httpd2.4.37 on centos8

Step 1: yum install httpd -y #Install httpd servi...

How to install theano and keras on ubuntu system

Note: The system is Ubuntu 14.04LTS, a 32-bit ope...

Detailed explanation of the installation steps of the MySQL decompressed version

1. Go to the official website: D:\mysql-5.7.21-wi...

JS implements a simple counter

Use HTML CSS and JavaScript to implement a simple...

A brief discussion on HTML ordered lists, unordered lists and definition lists

Ordered List XML/HTML CodeCopy content to clipboa...

Gogs+Jenkins+Docker automated deployment of .NetCore steps

Table of contents Environmental Description Docke...

In-depth explanation of Set and WeakSet collections in ES6

Table of contents Set is a special collection who...

Class in front-end JavaScript

Table of contents 1. Class 1.1 constructor() 1.2 ...

Docker installs ClickHouse and initializes data testing

Clickhouse Introduction ClickHouse is a column-or...

HTML tag overflow processing application

Use CSS to modify scroll bars 1. Overflow setting...