Home >Database >Mysql Tutorial >How to find out what the mysql account password is?

How to find out what the mysql account password is?

青灯夜游
青灯夜游Original
2020-10-27 09:44:1845110browse

Find the method: first run a cmd window as an administrator, enter "mysql -uroot -p", press Enter to enter the database; then use the "select host, user, password from mysql.user;" command You can view the account number and password.

How to find out what the mysql account password is?

(Recommended tutorial: mysql video tutorial)

Let me introduce to you how to go after installing mysql View mysql username and password.

Method:

under windows

1. Run cmd as system administrator.

2. View Is mysql started? If so, stop: net stop mysql.

3. Switch to the MySQL installation path: D:\WAMP\MySQL-5.6.36\bin; if the environment variable has been configured , there is no need to switch.

4. Enter at the command line: mysqld -nt --skip-grant-tables

5. Restart and run a cmd as administrator, enter: mysql - uroot -p, Enter to enter the database.

6. Find the mysql account password and execute this statement on the command line

select host,user,password from mysql.user;//即可查看到用户和密码

For more programming-related knowledge, please visit: Introduction to Programming! !

The above is the detailed content of How to find out what the mysql account password is?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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