tags:

views:

1123

answers:

1

I am trying to install and configure MySQL (version 4.1.22 on Windows XP) using the command prompt silently so it can be included within an installer for a different application. I thought I had everything installed and configured correctly but the MySQL service fails to start, even if I try to start it through the services snap-in.

I am currently doing the following:

  1. mysql-essential-4.1.22-win32.msi /passive
  2. MySQLInstanceConfig.exe -i -q "-lc:mysql_install_log.txt" ServerType=DEVELOPMENT DatabaseType=MIXED ConnectionUsage=DSS Port=3306 RootPassword=password

I get no errors or anything that would indicate the parameters are incorrect, the only indication of a problem is within the mysql_install_log.txt which says (See full log below):

  • Could not start the service MySQL. Error: 0

As far as I can see MySQL has all the configuration it needs and all paths referred to in the install log exit etc. I have also tried to configure using MySQLInstanceConfig.exe using the UI and that works fine.

This error is obviously referring to some missing configuration, what is it that I am missing?

Also please note:

  • I cannot upgrade to a newer version of MySQL
  • I am running this on a brand new Windows XP SP3 installation in a virtual machine
  • I am using the MySQLInstanceConfig parameters as defined here

The full install log:


Welcome to the MySQL Server Instance Configuration Wizard 1.0.8 Date: 2009-08-08 14:10:45

Installing service ...

Product Name: MySQL Server 4.1 Version: 4.1.22 Installation Path: C:\Program Files\MySQL\MySQL Server 4.1\

Creating configuration file C:\Program Files\MySQL\MySQL Server 4.1\my.ini using template C:\Program Files\MySQL\MySQL Server 4.1\my-template.ini. Options: DEVELOPMENT MIXED DSS STRICTMODE

Variables: port: 3306 default-character-set: latin1 basedir: "C:/Program Files/MySQL/MySQL Server 4.1/" datadir: "C:/Program Files/MySQL/MySQL Server 4.1/Data/"

Creating Windows service entry. Service Name: "MySQL" Parameters: "C:\Program Files\MySQL\MySQL Server 4.1\bin\mysqld-nt" --defaults-file="C:\Program Files\MySQL\MySQL Server 4.1\my.ini" MySQL. Windows service MySQL installed. Could not start the service MySQL. Error: 0

A: 

I know this question is ancient, and you've probably long ago found an answer, but hopefully this info might still be useful to someone.

I had this same problem with MySQL v5.1, and couldn't solve it in a good way. I ended up manually installing the service directly after running the config instance wizard.

e.g.

mysqld --install NameOfYourMySQLService --defaults-file=your_ini_file.ini

then manually starting the service, which I did through C# using the following code (except all the ugly retry stuff snipped to protect my fragile pride)

ServiceController[] services = ServiceController.GetServices("127.0.0.1");
foreach (ServiceController service in services)
{
    if (service.ServiceName == "NameOfYourMySQLService ")
    {
        service.Start();
    }
}

or if you're doing it in a batch file just

net start NameOfYourMySQLService

Hope this helps someone.

marcush