MySQL password modification example detailed explanation

MySQL password modification example detailed explanation

MySQL password modification example detailed explanation

I haven't used MySQL for a long time. Today, when I opened HediSQL to connect to MySQL, I found that I had forgotten the root password. I fiddled with the password modification operation for a while. I recorded it for later use. (Win10 native operation)

Shut down the MySQL service: net stop MySQL
Open a cmd console window as an administrator, enter the bin directory where MySQL is located, and execute mysqld --skip-grant-tables
Open another cmd window and execute the mysql command directly (since the 2nd operation can access the table without authorization, you can log in directly with mysql without a username and password)
Switch to mysql database: uses mysql;
Modify the password field of the user table: update user set password = password ( '123456' ) where user = 'root';
Perform the refresh operation: flush privileges; 
Exit mysql: quit;
Restart the MySQL service: net start MySQL

Step 2: Start the MySQL server

Step 3-7, change the user password

Thank you for reading, I hope it can help you, thank you for your support of this site!

You may also be interested in:
  • How to change password in MySQL 5.7.18
  • How to modify the password of MySQL 5.1 and remotely log in to the MySQL database
  • MySQL 5.7.16 changes password prompt ERROR 1054 (42S22): Unknown column ''''password'''' in ''''field list'''' reason
  • Quick solution to the error after changing the password of MySql
  • mysql modify password and set to allow remote login
  • Three ways to change mysql password and solutions to forget root password
  • MySql add user, authorization, change password and other statements
  • MYSQL basics: connect to MYSQL, change password, add user

<<:  JavaScript code to achieve a simple calendar effect

>>:  Ubuntu basic settings: installation and use of openssh-server

Recommend

idea combines docker to realize image packaging and one-click deployment

1. Install Docker on the server yum install docke...

Solution to forgetting mysql password under linux

The problem is as follows: I entered the command ...

Website background music implementation method

For individual webmasters, how to make their websi...

HTML Tutorial: Collection of commonly used HTML tags (4)

Related articles: Beginners learn some HTML tags ...

Detailed explanation of Angular parent-child component communication

Table of contents Overview 1. Overview of input a...

Mysql case analysis of transaction isolation level

Table of contents 1. Theory SERIALIZABLE REPEATAB...

MySQL 5.7.27 installation and configuration method graphic tutorial

MySQL 5.7.27 detailed download, installation and ...

HTML Tutorial: title attribute and alt attribute

XHTML is the basis of CSS layout. jb51.net has al...

How to use html2canvas to convert HTML code into images

Convert code to image using html2canvas is a very...

Vue uses custom instructions to add watermarks to the bottom of the page

Project Scenario Add a custom watermark to the en...

How to install babel using npm in vscode

Preface The previous article introduced the insta...

js dynamically generates tables (node ​​operations)

This article example shares the specific code of ...

Pure CSS to achieve the water drop animation button in Material Design

Preface You should often see this kind of special...