1

I installed MySQL earlier in the week and forgot the root password.

I assumed that uninstalling and re-installing MySQL would allow me to create a new root password. However, now during the re-installation process it's asking for me to provide the previous password that I don't have anymore.

Every suggestion that I've found to fix this issue states that I need to find MySQL within 'Services' of Windows but MySQL is not in there or the Task Manager.

1 Answer 1

1

I always use this solution to reset the password;)

  • Stop MySQL

    sudo service mysql stop 
  • Make MySQL service directory.

    sudo mkdir /var/run/mysqld 
  • Give MySQL user permission to write to the service directory.

    sudo chown mysql: /var/run/mysqld 
  • Start MySQL manually, without permission checks or networking.

    sudo mysqld_safe --skip-grant-tables --skip-networking & 
  • Log in without a password.

    mysql -uroot mysql 
  • Update the password for the root user.

    UPDATE mysql.user SET authentication_string=PASSWORD('YOURNEWPASSWORD'), plugin='mysql_native_password' WHERE User='root' AND Host='%'; EXIT; 
  • Turn off MySQL.

    sudo mysqladmin -S /var/run/mysqld/mysqld.sock shutdown 
  • Start the MySQL service normally.

    sudo service mysql start 

Edit:

This is a documentation for the Windows.

https://dev.mysql.com/doc/mysql-windows-excerpt/5.7/en/resetting-permissions-windows.html

Did you start the Mysql?

https://superuser.com/questions/666521/how-do-i-start-a-mysql-server-on-windows

Sign up to request clarification or add additional context in comments.

4 Comments

This might work if you're running on a nix system, but the poster mentions *Windows and Task Manager, which means a *nix solution won't work. :-)
Thanks for the response, but I'm still running into a couple issues. a) for your initial troubleshoot suggestion, where do I input those commands specifically? (My command line client is not even opening) b) I followed all the steps for both links that you shared and neither of those solutions solved the issue either
So the first solution is for Linux, The edit part is for windows. I found a step by step video on yt, let me know if it helps: link
@artmasterpl thanks for shooting over that link. I appreciate the help on this. I was able to get all the way up to ~2:35 into the yt video before running into a roadblock. Upon inputting 'net start mysql80' as the yt video suggests I get the error "service name is invalid"...Thoughts on how to solve this? Keep in mind that mysql was not even listed within my services before the step of stopping the services, which may have a relation to the issue at hand

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.