How to completely remove MySQL from Windows?

Solution 1:

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:

  • Windows XP: "C:\Documents and Settings\All Users\Application Data\MySQL\MySQL Server 5.1"
  • Windows Vista(?) / 7 / 8: "C:\ProgramData\MySQL"

After deleting that folder, I was able to reinstall from scratch.

Solution 2:

For Windows 7, it's in ProgramData\MySQL


Solution 3:

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.


Solution 4:

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 using MySQL 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:

C:\Program Files (x86)\MySQL\MySQL Installer for Windows\

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 then execute.

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:

C:\ProgramData\MySQL
C:\Program Files\MySQL
C:\Program Files (x86)\MySQL
C:\Users\user_name\AppData\Roaming\MySQL

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.

Tags:

Mysql