Completing MySQL Installation
The next step is to hit the internet. The MySQL Forum lists a case with my exact issue. Loading MySQL 5.1 on a Windows 2000 SP4 system, and receiving the error "Cannot Create Windows Service for MySQL. Error:0". The guru who responded says he's had this error frequently when trying to do a normal install from the .msi files on his PC. He therefore provides the code for a .bat file which I modified and tried to run. However, when triggered in this fashion, the .msi file for MySQL 5.1 doesn't actually install any files. Everything else in the .bat file runs fine and the .NET connector and MySQL GUI tools install beautifully. However, the MySQL server itself installs no files, only directories, and so the MySQL instance can't be created. I'm pretty confused. I hate this kind of configuration crap; this is exactly why I don't enjoy DB and server admin.
Part of the problem may be the MySQL is terribly messy. It throws files and folders in a number of odd locations and doesn't pick up after itself when you uninstall. I therefore don't know if the problem now is the fault of the .msi or if it believes the program is already installed because I haven't been able to locate one of these pieces of post-uninstall trash. Most of the locations are specified now in my .bat file. However, one of the sneaky locations may have been lying around since the very first time I tried to install this, C:\Documents and Settings\All Users\Application Data\MySQL\. Now that I've gotten that one, let me try running the .bat again. :( No luck. I've now burned 24 hours just trying to install this database. No wonder Microsoft guys use MS SQL even though it's nowhere near as good. Getting MySQL set up is turning out to be a pain in the A$$. If I had any other options right now, I would have trashed this right about now. *sigh*
I went back to the MySQL boards and did some more research. There's an odd page in the documentation in a chapter about something completely different; but it describes certain error messages that may be thrown after installation including "Cannot Create Windows Service for MySQL. Error:0" It says the Windows service already exists, and recommends deleting the service.
OK, I'm having problems just deleting the service. The procedure in the online MySQL documentation is out of date, and the link to Microsoft's website is defunct as well. No help there. I therefore Googled windows services and I've at least located the Services dialog. It's located under Start>Settings>Control Panel>Adminstrative Tools>Services. So all the command line stuff was just DBA preference, there's a perfectly decent GUI for this that no one has mentioned. However, once I get there, the supposed root of the problem, the fact that MYSQL is already registered, turns out to be incorrect. There's no such service installed. I sweep back through all the "spots" where MySQL leaves trash, and I've now confirmed as well as I can, that there can be no other pieces running around my computer. This includes removing the .NET connector, etc., etc. My computer is as MySQL-less as I will ever get it.
I'm ditching the .bat file, and I'm trying the .msi installer manually. I'm tempted to try Typical, however, that forces it to install everything on my tiny (and already maxed out) C: drive. Therefore, I'm running through the exact same process I tried the first time above, including configuring the system mostly for defaults by specifying Developer Machine, using UTF8, and installing as a Windows service with passwords. Cross your fingers. I'll know in about five minutes. You'll know in the next paragraph.
OK, I'm not completely certain what this means yet, however, when I press execute as the final step of the configuration wizard, it runs through each item on the checklist successfully - including start service, and apply security settings. When completed, I receive the these messages...
Configuration file created.
Windows service MySQL installed.
Service started successfully.
Security settings applied.
When I open Start>Settings>Control Panel>Adminstrative Tools>Services, I now see a new "MySQL" service running. It's status is "Started" and "Startup Type" is automatic, so hopefully when I boot up my computer from now on, MySQL will just be there. The sneaky data folder, C:\Documents and Settings\All Users\Application Data\MySQL\MySQL Server 5.1\data, is back and has about 30MB of stuff packed in it. I also couldn't get the .NET Connector which has my ADO.NET providers for MySQL to install anywhere except the C: drive. It supposedly is about 20MB. If those 50MB are really the only parts installed on the C: drive, I can live with that.
It turns out that indeed the MySQL instance was working beautifully at this point. By making sure no MySQL pieces were lying around and running the .msi installer, things went right. MySQL was installed and configured, an instance of the database was created, and the Windows service automatically starts when the computer boots up. So far as I'm concerned MySQL now runs transparently on my dev box and I don't have to worry about it. That's wonderful.
[chroniclemaster1, 2009/11/20]
I'm still chicken though, I wish there were some way to do a quick test just of the DB. The only way I know to check it is to create a connection in VWD. Now the GUI tools ought to do this as well. It may be time to install them and see what my options are. Since the .NET Connector still doesn't seem to be working properly in VWD, let's take a crack at the GUI tools next.
It turns out that the connector was fine. The problem is VWD. Visual studio offers a number of services to support 3rd party plugins like the integrated tools from MySQL. However, Microsoft decided that VWD shouldn't support plugins. So unless you've spent several hundred dollars (or more) on Microsoft development software, you won't get integrated development tools. This basically means you need to set up the connection in the web.config file manually (there are plenty of examples on the MySQL forums). After that, the GUI Tools are turning out to be far better and more user friendly than anything Microsoft has available.
[chroniclemaster1, 2009/11/20]