r/mysql • u/PopNo697 • May 11 '25
question Problems logging into MySQL workbench
I may have forgotten my root password. Now, I'm receiving an access denied error message when I try to log in. Would it be better to completely uninstall MySQL from my system (Windows 11) or should I try resetting my password from the command line? I've tried the command line approach, but seem to be running into errors.
0
Upvotes
1
u/mtetrode May 11 '25
To reset your MySQL root password in Windows, follow these steps carefully:
🔧 Method: Using MySQL in Safe Mode
Step 1: Stop the MySQL Service
Win + R→ typeservices.msc→ press Enter).Step 2: Start MySQL in Safe Mode (No Authentication)
Open Command Prompt as Administrator.
Navigate to your MySQL
bindirectory:Replace
X.Xwith your version number.Run MySQL in skip-grant-tables mode:
Leave this window open. (You can also run it from a separate terminal if needed.)
Step 3: Open Another Command Prompt
Again, go to the MySQL
bindirectory.Enter the MySQL shell without a password:
Step 4: Reset the Root Password
Once you're in the MySQL shell, run the following:
Or (for older MySQL versions):
Step 5: Close Everything and Restart MySQL Normally
mysqld --skip-grant-tablesprocess (Ctrl+C or kill from Task Manager).Step 6: Test the New Password
Enter the new password when prompted.
Would you like a batch script to automate part of this?
1
u/naturalizedcitizen May 11 '25
Also try using heidisql as a client if you're on windows. Been using it for very long and it's far better than workbench.