Get the App
SLTechnology News&Howtos  ›  Development  › 

What if I don't remember the Root password of Mysql?

Shulou Source: shulou.com Published: 2022-06-03 13:09:45 10月02日 Update

This article introduces the knowledge of "how to remember the Root password of Mysql". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

Start the command line first

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

The following operation is to operate some programs in the bin directory in mysql. If you have not configured the environment variables, you need to change to the bin directory in mysql to execute the following statements. Otherwise, it's invalid.

two。 Continue to run on the command line: mysqld-nt-- skip-grant-tables

3. Open a new command line to run: mysql-u root (if you do not configure the bin environment variable for mysql, you need to change to the bin directory to execute this statement)

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

Users and passwords can be viewed by select host,user,password from mysql.user;//

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

Update mysql.user set password=', fill in the password you want to set 'where user='root'' here.

Here I set an empty password.

After you have completed these operations, continue to run on the command line

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

Net start mysql;// starts the mysql service

At this point, mysql's root password forgetting solution is done.

This is the end of the content of "what to do if you don't remember the Root password of Mysql". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Tags: Passwords commands statements runs directories come on what to do content variables more environment knowledge facets switching configuration utility security learning and then just Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Microsoft Redmi Huawei Xiaomi vpn