Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Does anyone know how to complete uninstall MySQL from the command line? I'd like to uninstall it, the MySQL tools and I'd like it to remove its data that is in the Application Data. Furthermore I'd like to do it all from inside innosetup. This requires the command line.

MySQL installation and uninstallation REALLY isn't made easy. Its driving me nuts. Anyone who can help would REALLY be aiding my sanity ...

Edit: I'd like to make it clear that My installer calls the MYSQL installer. I want my uninstaller to call the MYSQL uninstaller. This is where my problem lies. How do I do this?

Edit2: Thanks to Joshua for the point of checking the registry. However I'm still confused. If I run MSIExec with the GUID offered it runs the installation ... NOT the uninstallation. Any ideas what causes this? Also I'd still like to know if there is a way to get the installer to kill the directory in Application Data

Edit 3: Seems you Don't use the uninstall string but doing "msiexec /uninstall {GUID}" will run the uninstaller! :D

Just need to know of a way to get the installer to delete teh Application Data directory or should i just delete it myself?

share|improve this question

migrated from stackoverflow.com Feb 5 '10 at 15:35

This question came from our site for professional and enthusiast programmers.

    
Cheers for the migrate :) –  Goz Feb 5 '10 at 15:39

2 Answers 2

up vote 1 down vote accepted

If MySQL can uninstall via Add/Remove Programs you can use the registry to find out exactly what it executes and work from there.

Open regedit and navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall and look at the subkeys there. I'm not sure if MySQL will have a key with its name or a unique ID but once you find it, look for the UninstallString value. That is the string that Add/Remove Programs runs when you click 'Remove'. I believe the ModifyPath will be executed if you click the 'Change' button.

Good luck!

share|improve this answer
    
Brilliant ... it DOES use a GUID but I can see it there. Now I wonder if the GUID is always the same ... only one way to find out! –  Goz Feb 5 '10 at 16:04

I'm not sure how extensive the provided uninstaller is, but you can feed it the /VERYSILENT, /SUPPRESSMSGBOXES and /NORESTART switches to uninstall it transparently from the command line if it's using InnoSetup. You'll probably want to uninstall the service too with mysqld-max-nt --remove.

share|improve this answer
    
MySQL does NOT provide an uninstaller. Thats my whole problem. The only way I can see to do it is via the Add/Remove programes control panel. –  Goz Feb 5 '10 at 15:51
    
If you have an entry in Add/Remove programs, there must be an executable it calls to uninstall it. If it isn't easy to find, you can also uninstall using wmic from the command line: wmic product where name="mysql" call uninstall . Replace mysql with the exact name in add/remove programs. –  John T Feb 5 '10 at 16:05
    
I tried that wmic command as you state. It didn't work. TBH its much easier using msiexec and the GUID ... –  Goz Feb 5 '10 at 23:31

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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