---mysql view username and password
select Host,user,password from mysql.user;
show DATABASES;
How to retrieve and reset the mysql database forgot login password
1. Open the folder where mysql.exe and mysqld.exe are located, and copy the path address (this machine is) D:\wamp\bin\mysql\mysql5.6.17\bin
2. Open the computer cmd command prompt and enter the folder where mysql.exe is located in the previous step (cd D:\wamp\bin\mysql\mysql5.6.17\bin)
3. Enter the command mysqld --skip-grant-tables and press Enter. At this time, the user authentication of mysql is skipped. Don't close this CMD window and open a new cmd command line window. (Note: Before entering this command, end the "mysqld.exe" process in the "Task Manager" to ensure that the mysql server has finished running.)
4. In the newly run CMD command line, go directly to the folder cd D:\wamp\bin\mysql\mysql5.6.17\bin, and then enter mysql. You can log in without any login parameters and press Enter. database.
7.show tables To view all tables, you will find a user table, which stores account information such as username, password, permissions and so on.
9. Change the root password, enter update user set password=password('123456') where user='root' and host='localhost'; the 123456 password can be set by yourself, see Query ok, 1 means successfully update 1 row , the password is changed successfully
10. Close the two command line windows, restart mysql, the problem is solved