MySQL Forums
Forum List  »  Newbie

Cannot reset root
Posted by: Gideon Engelbrecht
Date: July 08, 2023 01:05PM

After days of trying and following numerous internet posts (by the way Ghatgpt not helpful), I am really desperate.

I am using Mysql 8.3 and also Workbench.

Somehow I stuffed up my root password (root@127.0.0.1:3306). I cannot now connect via Workbench to my database (it asks for a password which I do not know).

So I decided to set it to reset it. These are the steps I followed :

1. Stopped MYSQL80 services. Windows 10 Local services

2. Created a text file (I used Notepad) in my root directory called mysql-init.txt with the following content : alter user 'root'@'localhost' identified by 'New';

3. Opened command prompt in admin mode and entered mysqld -- defaults-file=" C:\ProgramData\MySQL\MySQL Server 8.0\my.ini" --init-file="C:\mysqld -- defaults-file=" C:\ProgramData\MySQL\MySQL Server 8.0\my.ini" --init-file="C:\mysql-init.txt" --console

4. After I hit enter the cmd gives no messages (I was hoping it would with --console)

5. I then restarted the services

6. Deleted the mysql-init.txt in the root folder

7. I then opened Workbench and tried to connect to by database using the password "New". However I get an error Access denied for user 'root'@'localhost' (using password : YES)


Can anyone please free me from the rabbit hole I'm currently in?

Regards

Options: ReplyQuote


Subject
Written By
Posted
Cannot reset root
July 08, 2023 01:05PM
July 08, 2023 04:19PM
July 09, 2023 04:18AM
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.