当前位置:网站首页>A detailed solution to mysql8.0 forgetting password

A detailed solution to mysql8.0 forgetting password

2022-06-22 20:33:00 1024 Q

Catalog

One . problem :

Two : solve

1. close mysql service

2. Use cd The command switches to mysql Of bin Catalog

3. Open a new cmd window ,

4. Use the name mysql The database of , To the corresponding user The password of the table is empty

5. Close to step 2mysqld --console --skip-grant-tables --shared-memory The open mysql service ( Just close the window )

6. Re open mysql service , To achieve a password free login

7. Change Password

summary

One . problem :

It didn't work for a long time mysql , Forget the original root password

Two : solve 1. close mysql service

2. Use cd The command switches to mysql Of bin Catalog

Use mysqld --console --skip-grant-tables --shared-memory Here's the picture .

3. Open a new cmd window ,

mysql -u root -p Discovery can be directly Enter Key without entering the password mysql interface , Here's the picture

4. Use the name mysql The database of , To the corresponding user The password of the table is empty

Here's the picture

5. Close to step 2mysqld --console --skip-grant-tables --shared-memory The open mysql service ( Just close the window )6. Re open mysql service , To achieve a password free login

7. Change Password

Be careful root and localhost The quotation marks of must be English characters

ALTER USER 'root'@'localhost'IDENTIFIED WITH mysql_native_password BY 'XXX';//XXX For new password flush privileges

Re enter mysql You need to enter the new password you just set .

summary

This is about mysql8.0 Forget the password of the detailed solution to the article introduced here , More about mysql8.0  If you forget the content of password solution, please search the previous articles of software development network or continue to browse the relevant articles below. I hope you can support software development network more in the future !


原网站

版权声明
本文为[1024 Q]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/173/202206221905135409.html