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
1. Reverse proxy example 1 1. Achieve the effect ...
1. When to execute setUp We all know that vue3 ca...
The value of the background property in CSS backg...
#include <linux/moduleparam.h> 1. Module pa...
<template> <div class="demo"&g...
The following error is reported when MySQL joins ...
Background description: On an existing load balan...
Written in front When we operate the database in ...
What is a selector? The role of the selector is t...
Through JavaScript, we can prevent hyperlinks fro...
Table of contents 1. Browser local storage techno...
This tutorial shares the installation and configu...
This article example shares the specific code of ...
Table of contents 0. The kernel tree that comes w...
question The seamless scrolling of pictures and t...