Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MySQL reinstalled, but root password still there and I forgot it

I forgot my root password in MySQL 5.1 on Windows 7 I uninstalled and deleted the MySQL directory in Program Files

Then I installed 5.5, but get error 1045, saying: Access denied for user: 'root@localhost'

I thought that uninstalling MySQL, and reinstalling would allow me to create a new root password, but apparently not. Please help!

like image 793
Tim Avatar asked May 20 '11 05:05

Tim


1 Answers

Actually even after uninstalling the MySQL the data still remains in the directory which is not deleted by itself. So if you want to reinstall it from scratch then follow these simple steps:

Using Windows 7/8, here's what you need to do:

  1. Uninstall MySQL using the uninstaller
  2. Delete C:\Program Files\MySQL
  3. Delete C:\Program Files (x86)\MySQL
  4. Delete C:\ProgramData\MySQL
  5. Delete from any Users' AppData folders. Example: C:\Users\rdoverby\AppData\Roaming\MySQL
  6. Reinstall MySQL.

And then it will hopefully work fine!

like image 184
Himanshu Aggarwal Avatar answered Oct 16 '22 23:10

Himanshu Aggarwal