I have an old MySQL installation for which I do not have the password. How can I reset the password? My first idea was to completely remove it and reinstall with a new password.

I am using Windows Vista.


Using Windows 7, here's what I had to do:

  1. Uninstsall 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
| improve this answer | |
  • This doesn't work for me with Windows XP. Any ideas? – Amir Rachum Dec 29 '10 at 11:33
  • 1
    40 Firefox tabs open before finding this simple answer.. – Jake Berger Mar 22 '12 at 1:47
  • thank you, worked for me – Thor Apr 24 at 3:35

lg's answer is correct. One additional hint:

You can reset the root PW without reinstalling MySQL. See the documentation:

B.5.4.1. How to Reset the Root Password

| improve this answer | |

Uninstall MySql server from control panel and then delete the "data" directory. Usually the "data" directory is at the same level of "bin" directory (\Program Files\Mysql\Mysql Server 5.x\data). The user and root password are stored in the mysql database (data\mysql).

| improve this answer | |

I too was having the same issue. I uninstalled MySQL, removed the folder (C:\mysql in my case). Open Windows Explorer and goto Tools. Select the "View" tab and under "Hidden files and Folders" choose "Show hidden files and folders".

Now navigate to C:\Documents and Settings\All Users\Application Data. There should be a MySQL folder in there. Delete it and reinstall. Worked fine for me after that.

| improve this answer | |

to re install mysql (caused me alot of trouble and nothing in the postings seemed to help so i tried it hard till i got it right)

  1. stop and remove service using the mysql config wizzard OR ControlPanel/ stop MYSQL (then cmd prompt c:\sc delete mysql)
  2. Uninstall mysql using Add/remove programs
  3. Delete the 2 installations folders as below:- a. c:\Mysql data files folder b. c:\docs and settings\all users\application data\ Mysql

restart if u fill like but not mandatory

Reinstall and enjoy!!!!

| improve this answer | |

If you have problems uninstalling MySQLServer 5.5(mysql-5.5.9-win32.msi) in Windows 7, there are 4 easy steps.

  1. Run C:\Program Files\MySQL\MySQL Server 5.5\bin\MySQLInstanceConfig.exe >> NEXT>> REMOVE Instance>> NEXT>> EXECUTE>> FINISH

  2. Run MySQLServer Installer 5.5(mysql-5.5.9-win32.msi) >> NEXT>> REMOVE>> REMOVE>> OK>> FINISH

  3. Delete the folder C:\Program Files\MySQL

  4. Delete the folder C:\ProgramData\MySQL

REINSTALL MySQLServer 5.5(mysql-5.5.9-win32.msi) - With NEW PASSWORD...

hopefully useful..work 100%

This is actually will remove all the MySQL modules installed on your computer. If you want to remove a specific module, can be done this way: 1. same as above 2. Run MySQLServer Installer 5.5(mysql-5.5.9-win32.msi) >> NEXT>> REMOVE >> just remove the specific module ie: MySQL Server. 3. Delete the folder of the module you want to delete ie: C:\Program Files\MySQL\ 4. No need to delete C:\ProgramData\MySQL since it will be overwritten by step 5 5. Reinstall the module using the .msi file.

Hope this helps more ;)

| improve this answer | |

I've tried both unistalling and deleting the whole MySQL folder (plus a search for any file with "mysql" in the name just to be sure), and the root PW reset from the doc, and neither work. When I delete and reinstall the configuration is still there, as the only option in setup is "modify security settings" which requires an existing password, and skipping that I can't log in to my new install. I tried the init-file trick and it just hung for several minutes until I canceled the operation. So, any other ideas?

| improve this answer | |
  • 1
    I found the answer here: channels.com/episodes/show/6310023/… There was also a folder hidden in Program Data that I didn't get. BTW this was on Win7 Pro – Anonymous Feb 17 '10 at 3:35

If you are having problem uninstalling mysql in win 7

step1) Uninstall mysql from control panel >> add remove program

step 2) remove mysql folder from 1) program files 2) c:\programdata

Now try to Install it again.

You will get an option to reconfigure the mysql service while install mysql there will an option to stop and remove the mysql service.

Once you do this...try step 1 and 2 again

Do an installation again

and Voila it will work!!

| improve this answer | |
  1. First ‘Uninstall’ mysql from the Control panel.
  2. Then, remove the “C:\Program Files\MySQL” folder.
  3. Delete the mysql service my using command in command prompt “Sc delete mysql”
  4. Then, remove the “C:\Users\pc\AppData\RoaminMySql” folder.
  5. Again Reinstall a fresh copy….It will Work !!!
| improve this answer | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.