Wednesday, 28 August 2013

How to uninstall MySQL 5.6 from Windows XP/7/8 Completely

Recently i installed MySQL on my desktop (Windows 8) but when i restarted my desktop it became really very slow and i was not able to use it smoothly. So with great effort i uninstalled MySQL using the MySQL uninstaller.
Now I thought things are good not and decided to reinstall it.
On reinstalling, everything was successful but when i reach the configuration part where do you need to enter the service name, i tried to use the service name that i used in my previous installation of MySQL. This on finishing showed error that the service already exist.

Note: After uninstall also go to following locations and delete the MySQL directory if present- 
  • Delete C:\Program Files\MySQL
  • Delete C:\Program Files (x86)\MySQL
  • Delete C:\ProgramData\MySQL
  • Delete from any Users AppData folders. Example: C:\Users\<User_Name>\AppData\Roaming\MySQL
Issue: After you uninstall MySQL the windows service does not gets removed and still remains there.

Resolution: To remove the windows service follow the below steps-
  1. Click on Ctrl+R
  2. Type services.msc and press Enter. (This can also be accessed from Control Panel > Administrative Tools > services)
  3. Here in the main window press M and check for the MySQL service that is present.
  4. Stop the service by right clicking the name of the service if it is running and remember the name of the service.
  5. Now the main step - Open the Command Prompt with administrator privileges (If you are using Windows 8 check below how to do so).
  6. Type the following command - sc delete <name_of_the_service>
    Ex. sc delete MySQL where MySQL is the name_of_the_service
Voila, You have successfully removed MySQL service and can now reinstall MySQL without any errors

How to open command prompt with Administrator Privileges in Windows 8?
To open command prompt with admin privileges you just need to take your mouse to the bottom left of the screen and right click there.
On the windows you will see 2 options -
  • Command Prompt
  • Command Prompt (Admin)
Click on the second one and you are good to go.

2 comments :

  1. *Win+R

    I think you confused people.

    ReplyDelete
  2. Dude... that was very helpful. For future reference I now realised there was PROGRAM DATA I was missing when it came to completely flushing out old data, had missed that on so many occasions looking back. Nice little blogging shortcut.

    ReplyDelete