Mysql Root password forgotten, view or modify the solution (picture and text introduction)_PHP tutorial

WBOY
Release: 2016-07-21 15:06:32
Original
877 people have browsed it

First start the command line


1. Run from the command line: taskkill /f /im mysqld-nt.exe


The following operations are to operate some programs in the bin directory of mysql. If no environment variables are configured, you need to switch to the bin directory of mysql and execute the following statements. Otherwise it will be invalid

2. Continue running on the command line: mysqld-nt --skip-grant-tables


3. Open a new command line and run: mysql -u root (if the bin environment variable of mysql is not configured, you need to switch to the bin directory to execute this statement)


If you don’t want to change the password, but just want to see the original password. You can execute this statement on the command line

select host,user,password from mysql.user;//You can view the user and password


If you want to change the password, execute the following statement on the command line

update mysql.user set password='Fill in the password you want to set here' where user='root';


Here I set a blank password.

After completing these operations, continue running on the command line

taskkill /f /im mysqld-nt.exe;//For safety reasons, end it first, because now you can log in directly with mysql -u root

net start mysql;//Start the mysql service

At this point, the solution to the forgotten root password of mysql is complete.

I am also a novice, there may be some low-level problems in this process, I hope you can give me some advice and criticism. Only by finding my own problems and solving them can I make progress. Let this newbie like me get wings as soon as possible. I also want to fly.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/327625.htmlTechArticleFirst start the command line 1. Run on the command line: taskkill /f /im mysqld-nt.exe The following operations It is to operate some programs in the bin directory in mysql. If you do not configure environment variables, you need to...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template