- Stop the
MySQL 8.0
service from services - Go to path C:\Program Files\MySQL\MySQL Server 8.0\bin and open
cmd
- Run
mysqld --console --skip-grant-tables --shared-memory
- Open new
cmd
in the same path - Run following commands
mysql -u root
select authentication_string,host from mysql.user where user='root';
UPDATE mysql.user SET authentication_string='' WHERE user='root';
- Now close both the
cmd
. - Try to start the MySQL 8.0 service.
- Connect using username as root & password as blank.
- Change the password from the user managerment.
Created
December 5, 2019 18:04
-
-
Save pishangujeniya/0f839d11a7e692dadc49821c274a2394 to your computer and use it in GitHub Desktop.
Reset MySQL 8.0 root Password in Windows
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is just a test MySQL server that I have set up on my local machine. I was able to log in previously, but it has been a while and I cannot remember what I set my password to, so I am trying to reset it. I'm hoping someone might be able to help me out because I haven't been able to find anywhere online that has a solution.
I followed the steps in OPs post and can see that the password has been changed. However, as soon as I close out the cmd windows and try to log back in, I get an error that says access denied. I have also tried multiple other methods to change the password, and in all of those cases I am also told that my access is denied.
Thank you