I have previously used MySQL for a class about a year ago and not since. I've forgotten the password and I need to use it again. I don't need to be able to access any previous databases, so I tried stopping the service in command prompt and uninstalling then re-installing MySQL but this still resulted in me getting stuck at the "Accounts and Roles" section of the MySQL Installer where it asks for my root password.
Is there a way I can reset it or start a new root account all together? I've seen tutorials for Ubuntu but I'm not knowledgeable enough yet to translate this to windows.
Best Answer
It's possible re-initialize the data directory to produce an empty MySQL instance. Here is the documentation describing the process: https://dev.mysql.com/doc/refman/8.0/en/data-directory-initialization.html .
It tells the command to perform is:
or the following if you want to connect as root without password:
The data currently in the data dir would be overwritten. If there still is a chance it might be needed in future, you may find datadir param in my.cnf and backup the directory before proceeding to re-initialization.
Another possible option is to uninstall MySQL, remove or rename datadir as found in my.cnf and install again. It shouldn't ask for the old root password then.