(I realize there are similarly-titled questions, but this one is really 'how do I reset the password', and this one doesn't specify an OS and has only gotten Linux-oriented answers.)
On Windows XP, I just uninstalled MySQL and deleted the folder that it was installed in. I then rebooted and reinstalled MySQL.
When it comes back up, it still has the databases it had before the uninstall.
Where did it keep that database info? How do I completely remove MySQL and start over, as if I'd never installed it?
Figured it out
To fully remove MySQL, you have to remove the data folder, too, which is where the database info is actually stored.
It turns out that the "Typical" installation option (on Windows XP) puts the data in:
After deleting that folder, I was able to reinstall from scratch.
For Windows 7, it's in ProgramData\MySQL
For complete removal of MySQL installed from MSI package [MySQL 8 on Windows 10 PC.]
MySQL programs can be uninstalled one by one from
Control Panel > Add or Remove Programs
or usingMySQL Installer
application.Using MySQL Installer: Find MySQLInstaller.exe or MySQLInstallerLauncher.exe (both do the same job)
By default, installer reseides in the System folder where Windows is installed. In my PC it was in below location:
A start menu shortcut may also be available on default installation. Look for
MySQL Installer - Community
Double-click on MySQLInstaller (or MySQLInstallerLauncher) and the MySQL installer window will appear. Here you'll see Add, Modify, Upgrade, Remove, etc. options. Select
Remove
.Again, you can remove one by one or all at once by selecting
Product
and thenexecute
.This will take some time, installer may freeze in the middle, just kill the process and start again(takes a lot of patience). Don't worry, installer will start where it stopped.
Note: When MySQL is removed using this method, only the installed components are removed. Any database information (including the tables and data), import or export files, log files, and binary logs produced during execution are kept in their configured location.
In default installation, MySQL files are stored in below locations:
The
C:\ProgramData
directory is hidden by default, thus installer will not remove this folder.To delete MySQL completely, check above locations and remove MySQL folders manually if they exist. Now MySQL should be removed completely along with all configurations and databases.
Uninstalling from Control Panel: I believe we all know how to uninstall programs from Control Panel.
For the benefit of anyone else arriving here looking for the answer, here's a more generic means of locating it, especially if MySQL has been installed somewhere other than the default location (something I'm prone to do).
Searching each of the local drives for "mysql", which will locate both the program and data folders, as "mysql" forms part of the executable name, regardless of version, and there will always be a "mysql" table.
The log files may be in a different location altogether and the best way to locate those is through the config file, which on Windows will normally be named "my.ini". However, if someone has created this installation from source that file could potentially be called anything at all but that would definitely be an unusual case.
Ideally you should uninstall the conventional way (add/remove programs or whatever Microsoft has named it this week) first but if for some reason you're just going to delete everything don't forget to stop the MySQl service(s) first.
The data folder was placed here for me, I'm running windows 7 64bit.
C:\ProgramData\MySQL
All i did was search for folders and files with the name "MySQL" and deleted them all. After that I had no old files at all and could start from scratch again.
One thing not mentioned, or I just didn't see is that for a windows server you should also remove the folders from appdata below is the example of an administrator user folder to remove from :
C:\Users\Administrator\AppData\Roaming\MySQL
If you downloaded from MYSQL Installer, search for it & open. It can install, repair, uninstall in one shot for connectors, server etc.
It may even work if you installed individually I think.
The name is something like these when you download
mysql-8.0.15.0_Win32-64.msi mysql-8.0.15-winx64.msi