Stop MySQL Service Windows can right-click My Computer--Manage--Services and Applications--Services--find the corresponding service and stop it Password-free login Switch to the MySQL installation path: D:\mysql-5.7.24-winx64\bin; if the environment variable has been configured, you do not need to install the directory again Open a CMD command window and enter the following command in the command line: For databases older than 8.0, run the following command: Enter the database Restart a cmd command window as an administrator, enter: mysql -uroot -p, Enter to enter the database If you don't want to change the password, but just want to see the original password, you can execute this statement in the command line select host,user,password from mysql.user; //You can view the user and password Note: There is no password field in MySQL 5.7 and above. It is encrypted and changed to authentication_string Change Password Execute the following statements in the command line use mysql update user set password=password("new_password") where user="root"; // Change 'new_password' here to the password you want to set flush privileges; quit Note: In MySQL 5.7 and above, replace the statement with update mysql.user set authentication_string=password('new_password') where user='root'; // Change 'new_password' to the password you want to set MySQL 5.7 version password setting rules: Restart MySQL Restart MYSQL and enter your password to log in! mysql -u root -p Enter the password and log in successfully Summarize This is the end of this article about how to solve MySQL root password error number 1045. For more information about MySQL root password forgetting, please search 123WORDPRESS.COM's previous articles or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: Vue3 navigation bar component encapsulation implementation method
>>: Detailed explanation of Docker container cross-host multi-network segment communication solution
Preface This article mainly introduces the releva...
List style properties There are 2 types of lists ...
Recently, the business side reported that some us...
Table of contents Method 1: The simplest way to s...
This article mainly introduces three methods of i...
Table of contents aforementioned VARCHAR Type VAR...
I want to make a docker for cron scheduled tasks ...
Fabric.js is a very useful canvas operation plug-...
I have been engaged in Java web development for mo...
1 Introduction In the article "Start Postgre...
Create a Directory cd /usr/local/docker/ mkdir je...
Table of contents 1. Traversal Class 1. forEach 2...
Preface I recently encountered this requirement a...
Viewing and Setting SQL Mode in MySQL MySQL can r...
Introduction to Docker Docker is an open source a...