MySQL Forums
Forum List  »  Newbie

Re: Cannot reset root
Posted by: Barry Galbraith
Date: July 09, 2023 04:17AM

I made a file mysql-init.txt and saved it in C:\Users\Barry.
The file contains this.
ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass';


I stopped MySQL server from services.msc

I then ran this from a command prompt

C:\Users\Barry>mysqld --defaults-file="C:\\ProgramData\\MySQL\\MySQL Server 8.0\my.ini" --init-file="C:\\users\\barry\\mysql-init.txt"

I then opened another command prompt, and logged into mysql with -uroot -pMyNewPass

I terminated the Command Prompt that started MySQL with the change by Ctrl+C
I started the MySQL service and then Workbench required MyNewPass for root to login.
Once logged in, I changed my root password back to what it should be.

So. The process in the refman works for me. Follow the steps exactly.

Good luck,
Barry.

Options: ReplyQuote


Subject
Written By
Posted
July 08, 2023 01:05PM
July 08, 2023 04:19PM
July 09, 2023 04:18AM
Re: Cannot reset root
July 09, 2023 04:17AM
September 20, 2023 07:29AM
September 23, 2023 03:50PM
December 08, 2023 12:49AM
July 11, 2023 04:49AM


Sorry, only registered users may post in this forum.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.