Bug #40331 Installation terminates after uninstall/second install during launch of mysqld
Submitted: 25 Oct 2008 21:54 Modified: 27 Oct 2008 17:53
Reporter: Joachim Bartels Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Installing Severity:S2 (Serious)
Version:5.1.28 OS:Windows (Vista Ultimate)
Assigned to: CPU Architecture:Any
Tags: Cannot create Windows service for MySQL, installation

[25 Oct 2008 21:54] Joachim Bartels
Description:
with regard to closed bug #24215:

Read through all of your comments - but the bug is still in existence in 5.1.28! Yes, there is a prompt for an old pw (and it happens, I know it ;-)), but I found no way to run the dialog to its end. The attempt to launch the mysqld-service is terminated (as described in #24215). Spent the whole day with hunting for a solution, but don´t know what to do *exactly*? Am I really forced to reinstall my Windows to use the database in a different folder?

The problem occured: Installed MySQL 5.1.28 to default destination. Everything worked fine, tested MySQL with MS-Access and ODBC. Found a hint of Michael Kofler, that installation in Programms folder will cause future problems, since the folder is read only. So I made an uninstall with Windows uninstaller (not with the MySQL uninstalller, found that only later). Tried second install to C:\MySQL51 and ran into the problem decribed in #24215. Tested several approaches to work around the problem: changed path to folders in my.ini, tried with and without passwords during installation, different paths - nothing worked, the launch of the mysqld was not possible. Please tell, what can I do to solve the problem?

Thanks, Joachim

How to repeat:
see #24215

Suggested fix:
please tell
[26 Oct 2008 6:14] Sveta Smirnova
Thank you for the report.

Please provide your error log file.
[26 Oct 2008 18:00] Joachim Bartels
Hmm, is there an error log without a single proper start of mysqld? - I looked through my files in \MySQL, but couldn´t find any logs or files with a hint to logs. I´d like to repeat, that the problem occured during *(re-)install*, not during any server action. Please tell, what should I do? Thank you! Joachim
[27 Oct 2008 12:45] MySQL Verification Team
Try to start the server as standalone in the aim to look for error messages:
Open a command prompt.
Go to install \bin directory.
issue: mysqld --defaults-file=path_for_your\my.ini --standalone --console

and then see if some messages error are printed.
[27 Oct 2008 17:24] Joachim Bartels
There are a lot of messages with regard to missing innodb settings/folders or other missing elements (due to the terminated installation), but I think the problem is different: The installer finds left overs from a former mysql-installation and runs into a problem - as described perfectly well by

Paul DuBois (Noted in 5.0.60, 5.1.24, 6.0.5 changelogs).

"If a user installed MySQL Server and set a password for the root
user, and then uninstalled and reinstalled MySQL Server to the same
location, the user could not use the MySQL Instance Config wizard to
configure the server because the uninstall operation left the
previous data directory intact. The config wizard assumed that any
new install (not an upgrade) would have the default data directory
where the root user has no password. The installer now writes a
registry key named FoundExistingDataDir. If the installer finds an
existing data directory, the key will have a value of 1, otherwise it
will have a value of 0. When MySQLInstanceConfig.exe is run, it will
attempt to read the key. If it can read the key, and the value is 1
and there is no existing instance of the server (indicating a new
installation), the Config Wizard will allow the user to input the old
password so the server can be configured."

My one and only question is, why does the installer prompts for the old pw and how can I bypass this question to get a straight installation to the end? One possible reason is, that the bug is not fixed, a second one, that there is a registry info (or any other snippet) that causes the pw-question. I already used a registry cleaner after uninstall, but obviously it is not possible to clean out the former installation. Do you have any hints, what kind of registry (or other) info causes this problem? I found this problem mentioned in several bug reports - has anybody found a solution yet?

Thank you, kind regards! Joachim
[27 Oct 2008 17:53] Joachim Bartels
Ok, problem solved, thanks to all!

The solution was inspired by a hint of Paul: "... If the installer finds an existing data directory, ..." - means, there has to be a data directory, that was left untouched during the first uninstall (in my case a windows uninstall). And there is such a directory in the *hidden* ProgramData-folder (don´t now why it has to be hidden, seems to be a great MS invention). If you want to solve the installer problem, just delete the MySQL-folder in this hidden directory - that´s all. Oh, boy, took me 4 days ...