What to do if you forget your mysql password

What to do if you forget your mysql password

Forgot your MySQL password twice? At first I did the stupidest thing, uninstalling and reinstalling.

Now there is a way to set the password back without uninstalling. The knowledge comes from the Internet. I have organized it here briefly. If you meet friends with the same problem, you can try it.

The following implementations are all completed on Windows systems.

first step

Find mysqld.exe in the Task Manager and end the process.

Step 2

Find the bin directory under the mysql installation directory. Mine is C:\Program Files\MySQL\mysql-5.6.24\bin

Open a console in this directory and enter: mysqld --skip-grant-tables

Step 3

Switch to the path just now and open a new controller

1) Input: mysql

2) Input: show databases;

3) Input: use mysql

4) Input: show tables;

At this time you can see the user table

Input: select user,password,host from user; you can see the contents in the table.

We now modify the data in the table through update.

Input: update user set password=passwrod("123456") where user="root" and host="localhost";


Since then, the mysql password has been changed.

The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM.

You may also be interested in:
  • What to do if you forget the initial password of MySQL on MAC
  • Solution to forgetting the root password of mysql under linux
  • Solutions to forget mysql root password in Linux environment (three)
  • How to reset the MySQL password after forgetting it in Mac operating system
  • What to do if you forget the MySQL root password? How to change the root password
  • How to view or modify the root password of MySQL if it is forgotten (with pictures and text)
  • The best solution to forgetting mysql password
  • How to modify mysql password if you forget it
  • Solution to forgetting mysql password in MAC

<<:  Centos 7 64-bit desktop version installation graphic tutorial

>>:  JavaScript implements a box that follows the mouse movement

Recommend

Detailed process of modifying hostname after Docker creates a container

There is a medicine for regret in the world, as l...

Create an SSL certificate that can be used in nginx and IIS

Table of contents Creating an SSL Certificate 1. ...

Recommend a cool flashing alarm button

The effect is as follows: The code is as follows ...

Detailed explanation of the difference between tags and elements in HTML

I believe that many friends who are new to web pag...

Complete steps to quickly build a vue3.0 project

Table of contents 1. We must ensure that the vue/...

Delegating Privileges in Linux Using Sudo

Introduction to sudo authority delegation su swit...

How to run the springboot project in docker

1. Click Terminal below in IDEA and enter mvn cle...

Detailed steps to install python3.7 on CentOS6.5

1. Download Python 3 wget https://www.python.org/...

How is a SQL statement executed in MySQL?

Table of contents 1. Analysis of MySQL architectu...

W3C Tutorial (16): Other W3C Activities

This section provides an overview of some other i...

A collection of information about forms and form submission operations in HTML

Here we introduce the knowledge about form elemen...

VUE+Canvas implements the game of God of Wealth receiving ingots

Welcome to the previous canvas game series: 《VUE ...