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

Cross-database association query method in MySQL

Business scenario: querying tables in different d...

Example operation MySQL short link

How to set up a MySQL short link 1. Check the mys...

HTML form tag tutorial (3): input tag

HTML form tag tutorial, this section mainly expla...

Nginx cache files and dynamic files automatic balancing configuration script

nginx Nginx (engine x) is a high-performance HTTP...

Detailed explanation of Vue's props configuration

<template> <div class="demo"&g...

Docker automated build Automated Build implementation process diagram

Automated build means using Docker Hub to connect...

Learn Node.js from scratch

Table of contents url module 1.parse method 2. fo...

Solve the margin: top collapse problem in CCS

The HTML structure is as follows: The CCS structu...

Example of how to install nginx to a specified directory

Due to company requirements, two nginx servers in...

A small collection of html Meta tags

<Head>……</head> indicates the file he...

Detailed explanation of JavaScript upload file limit parameter case

Project scenario: 1. Upload file restrictions Fun...

Tutorial on binary compilation and installation of MySql centos7 under Linux

// It took me a whole afternoon to install this, ...

Implementing a simple carousel based on JavaScript

This article shares the specific code of JavaScri...