Bug #43295 The service could not be started. Error: 0
Submitted: 1 Mar 2009 23:45 Modified: 7 Dec 2016 18:38
Reporter: Ana Dom Email Updates:
Status: Unsupported Impact on me:
None 
Category:MySQL Server: Installing Severity:S1 (Critical)
Version:5.1 OS:Windows
Assigned to: CPU Architecture:Any

[1 Mar 2009 23:45] Ana Dom
Description:
I uninstall MySQL 5.1 without first stopping the existing MySQL service and install several time MySQL using mysql-5.1.31-win32.msi or the MySQL Configuration Wizard, and I always get this error: 
"Error: Cannot create Windows service for MySql. Error: 0"

I read and did all the others answers about this error but I couldn't resolve the problem. Can someone help me? Thanks in advance.

I use Windows XP

How to repeat:
I uninstall MySQL 5.1 without first stopping the existing MySQL service and install several time MySQL using mysql-5.1.31-win32.msi or the MySQL Configuration Wizard, and I always get this error: 
"Error: Cannot create Windows service for MySql. Error: 0"

I read and did all the others answers about this error but I couldn't resolve the problem. Can someone help me? Thanks in advance.

I use Windows XP
[2 Mar 2009 8:53] Sveta Smirnova
Thank you for the report.

Have you seen message about you need to restart server during installation? Please send us content of MySQL server error log. Also, please, check Windows for application errors.
[2 Mar 2009 14:51] Ana Dom
I didn't see any message about I need to restart server during installation.

MySql couldn't create data directory so that it didn't create error log.

The reported for mysql in the event view were:
 - Plugin InnoDB init function retun error
- Plugin InnoDB registration as a storage engine failed
[2 Mar 2009 15:22] MySQL Verification Team
Thank you for the feedback. Could you please see if you find InnoDB file like ibdat1, ib_logfile0 and print here the output of dir command, attach here the my.ini file too. Thanks in advance.
[2 Mar 2009 21:43] Ana Dom
my.ini

Attachment: my.ini (application/octet-stream, text), 8.75 KiB.

[2 Mar 2009 21:44] Ana Dom
I did'nt find any file like ibdat1, ib_logfile0.
[3 Mar 2009 11:55] MySQL Verification Team
Thank you for the feedback. Please see if actually doesn't exist these files at:

C:/Documents and Settings/All Users/Application Data/MySQL/MySQL Server 5.1/Data/

and also verify if a directory called Data was created at:

"C:/Program Files/MySQL/MySQL Server 5.1/

Using the Control Panel->Administration Tools->Services see if actually a service for MySQL exists and stopped, then go using a command prompt to:

C:/Program Files/MySQL/MySQL Server 5.1/bin

and issue:

mysqld --defaults-file="C:/Program Files/MySQL/MySQL Server 5.1/my.ini" --standalone --console

Print here the error messages printed. Thanks in advance.
[3 Mar 2009 16:20] Ana Dom
--this directory "C:/Documents and Settings/All Users/Application Data/MySQL/MySQL Server5.1/Data/" doesn't exist.

--Any data was create at "C:/Program Files/MySQL/MySQL Server 5.1/"

--the service mysql was created but was stop and could'nt start because
I get the error ""An unhandled win32 exception ocurred in mysql.exe[1384]"

I run mysqld and I get an error telling:

InnoDB: about forcing recovery.
090303 16:03:58 - mysqld got exception 0xc0000005;
This could be because you hit a bug. It is also posible that this binary or one of the libraries it was linked against is corrupt, improperly built, or misconfigured. This error can aslo be caused by malfunctioning hardware.
We eill try our best to scrape up some info that will hopefully help diagnose the problem, but since we have already crashed, something is definitely wrong and thi may fail.

The error is longer. I could'n get it in a file.
[3 Mar 2009 18:04] MySQL Verification Team
Thank you for the feedback; The directory below which you said doesn't exists is what the my.ini has:

#Path to the database root
datadir="C:/Documents and Settings/All Users/Application Data/MySQL/MySQL Server 5.1/Data/"

so please see if you have the data dir at:

C:/Program Files/MySQL/MySQL Server 5.1/data

and if yes, edit the my.ini file changing the datadir with:

datadir="C:/Program Files/MySQL/MySQL Server 5.1/Data/"

Try again if you get errors, please print the output of dir command in
data folder. Thanks in advance.
[3 Mar 2009 18:29] Ana Dom
these directories ="C:/Documents and Settings/All Users/ApplicationData/MySQL/MySQL Server 5.1/Data/" 
and "C:/Program Files/MySQL/MySQL Server 5.1/data" don't exist.

I get the "my.ini" file from C:/Program Files/MySQL/MySQL Server 5.1/

I wil try to get the error.
[3 Mar 2009 19:07] Ana Dom
I couldn copy erro from msdos console. I try many ways but I couldnt do it. I dont know what to do.
[3 Mar 2009 19:56] MySQL Verification Team
My guess is that the below directory exists:

C:/Documents and Settings/All Users/Application Data/MySQL/MySQL Server 5.1/Data/

Anyway open a command prompt and go to the install directory:

C:/Program Files/MySQL/MySQL Server 5.1/

and issue:

bin\mysqld --defaults-file="C:/Program Files/MySQL/MySQL Server 5.1/my.ini" --standalone --console

and see and print here the error messages. Thanks in advance.
[4 Mar 2009 15:58] Ana Dom
Any data directory exists, I remove mysql using "add/remove program". Then I try install mysql again but it does'nt install ok, it stop when try to start mysql service.
During installation ask me for old administration password and the new one. If as the installation know that exixts a previuos installation. 

I run "mysqld --defaults-file="C:/Program Files/MySQL/MySQL Server5.1/my.ini" --standalone --console" and get an error but I dont kwno how can copy the message display in the windows console. Do you how execute mysqsld from console and send the output to a file.
[4 Mar 2009 16:29] MySQL Verification Team
In the console windows where you get the error message rigth click and select 'mark' in the menu then with the mouse select the text in the console windows, hit enter and then paste in the bug report new comment.
[4 Mar 2009 20:07] Ana Dom
Thank you for your help. I'll send the file with the error I get.
[4 Mar 2009 20:08] Ana Dom
Mysql Error

Attachment: mysqlError.txt (text/plain), 5.70 KiB.

[4 Mar 2009 23:52] MySQL Verification Team
Looking you err file a server crash is happening by InnoDB maybe the reason
is their data and log files corrupted.
Edit your my.ini file adding the skip-innodb option like below:

[mysqld]

# The TCP/IP Port the MySQL Server will listen on
port=3306
skip-innodb

then try to start the service and go to your install directory and using
the mysql.exe client issue:

c:\Program Files\MySQL\MySQL Server 5.1>bin\mysql -uroot -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 17
Server version: 5.1.31-community MySQL Community Server (GPL)

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> show variables like "datadir";
+---------------+---------------------------------------------+
| Variable_name | Value                                       |
+---------------+---------------------------------------------+
| datadir       | C:\ProgramData\MySQL\MySQL Server 5.1\Data\ |
+---------------+---------------------------------------------+
1 row in set (0.41 sec)

mysql>

if you didn't applied the security setting then just hit enter when prompted
for the password. The above command show you where is the data directory.
Exit the client with:

mysql> exit

then stop the service and go to the directory you saw and delete all the InnoDB
files ibdata and ib_logfileX. Try to start the server.
[5 Mar 2009 11:55] Ana Dom
I add the line skip-innodb in my.ini file and try to start service but I receive the error: Could not start the mysql service on the local machine

I did, only for testing, c:\Program Files\MySQL\MySQL Server 5.1>bin\mysql -uroot -p and get the error:  ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost' (10061).

My installation of the myqsl server could finish, it stop when try to start de service.
[5 Mar 2009 15:49] Steven Albert
I am having the same problem as the reporter. I had been running 5.1.31 successfully on XP Professional with SP3 until I somehow messed up some configuration settings, so I decided to reinstall. I believe the last setting I changed that I apparently should not have resulted in Windows not being able to start the service because the file could not be found. The setting was related to the binary directory being changed or removed or something to that effect. I also tried fooling with the named pipes setting in an attempt to get PHP communicating with the server. I can't be sure what exactly I did to start the chain of problems.

Reinstalling 5.1.31 gives me the bug reported here. Installing 5.1.32 does not help. Deleting all MySQL directories I could find and then reinstalling does not help. Unless files are stored elsewhere on the hard drive, I would guess this is a registry problem. I've tried all of the steps recommended by the professionals and have gotten the same results as the reporter in all situations.

I also do not understand how subsequent installations know there was a root password after uninstallation.
[10 Mar 2009 21:08] Lori Wilkins
I am running Windows Vista 32-bit and have had the same issue(s).  There are many reports of this problem on the Install forum(s).  It appears to be a show-stopper --- can't run mySQL after the install.  I have deleted all subdirs and all my.ini files and retried this several times using both the .msi install and the .zip.  I can't ever get mysql to start.  I also edited the registry and removed the mySQL reference, then tried again.  No luck.
[12 Mar 2009 1:00] Harsha Wijayawardhana
I'm running Windows Vista Business, and I installed using msi mysql-5.1.32-win32.
I cannot start the mysql server service and it aborts and gives error 1067. In the logs it says plugin Innodb has failed as storage type. Once I skip the Innodb and started the MySQL service, it say INNODB unknown table type. Is this bug has been fixed, or can anyone help to overcome this

harsha wijayawardhana
[17 Mar 2009 13:00] MySQL Verification Team
Thank you for the feedback. Looking the error file is clear that you have a data directory and you had not able to find it. Please try again setting your Explorer to show hidden files.
[20 Mar 2009 15:06] Danielle Hallett
I'm having exactly the same issues as the users above.

In a nutshell, re-installing MySQL 5.1 appears to be impossible as the service always fails to start.

I have gone through the system with a "fine toothed comb" removing every reference, folder, datafile and registry setting etc. I can find related to MySQL and it still fails to start.

I feel like a complete novice saying this, but I am on the verge of re-installing the OS in an attempt to install 5.1
[26 Mar 2009 14:42] Daniel Prentis
I had the same problem on Windows XP (Czech Edition). It seemed to be caused by a Czech character in the data path, since this is "C:\Documents and Settings\All Users\Data aplikací\MySQL\MySQL Server 5.1\data\" on my system. "Data Aplikací" contains a Czech character "í", which seems to be wrongly interpreted by the mysql service as "Ă" (according to the event viewer).

I solved the problem by copying the entire contents of this directory to "C:\Documents and Settings\All Users\Application Data\MySQL\MySQL Server 5.1\data\" and changing the datadir variable in my.ini to point there.

In case you have a non-English version of Windows XP, this may solve the problem for you.
[31 Mar 2009 16:18] golf lam
The service could not be started. Error: 0

Attachment: my.ini (application/octet-stream, text), 8.75 KiB.

[1 Apr 2009 0:12] Gino Kühne
Hi everyone

- i've setup a fresh Windows XP SP3 machine, all updates done...
- made the setup of MySQL into %programfiles%\MySQL\MySQL Server 5.1
- one the application got installed, i've started to create a MySQL Server 
  instance.
  - i've choosen "Detailed Configuration"
  - then "Server Machine"
  - then Transactional Database Only
  - the Database location is c:\Databases
  - then "OLTP"
  - then "enable TCP/IP ; Add Firewall exception.. ; Strict Mode"
  - then "UTF8"
  - then "install as Windows Service ; Include Bin Directory in Windows PATH"
  - i've set the root password (8 characters)
  - then i've started "Execution"

Error Message: Could not start Service ...

Solution:      1. Remove Instance
               2. Deinstall MYSQL
               3. Remove %alluserprofile%\Application Data\MySQL
               4. Remove rest of %programfiles%\MySQL
               5. Reboot
               6. Reinstallation of MYSQL
               7. Creation of MYSQL Instance with default values
               8. Reconfiguration of the Instance with the Configuration Tool

Remarks: MYSQL seems not to be able to use a defined location for the server 
         instance. The product is not stable at all and i wil never ...!! never
         use this product in a production environment on client server 
         environments. Nice for fun, but not to make money with it!

Greetings from switzerland,
Gino
[1 Apr 2009 7:55] Sveta Smirnova
Gino,

thank you for the feedback.

Please provide Windows error message regarding to "Could not start service" and error log file.
[8 Apr 2009 22:57] John Anderson
I have seen the same problem. But I would like to emphasisze that this has nothing to do with 'previous installs of MySQL'. I occurs on virgin Win2003 servers as well.

My question to MySQL is; why is the default for data set to:
C:\Documents and Settings\All Users\Application Data\MySQL\MySQL Server 5.1\

You know the permission for anything in Documents and Settings is different than say the 'Programs Files' directory or even say, C: yes? I see a little problem here do you?
[1 May 2009 23:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
[10 Jul 2009 19:49] greg hoglund
I would like to report that I reproduced this exact bug on version 5.1 downloaded last night July 9th, 2009.  Hasn't anyone bothered to fix this issue yet?  It was a fresh install on Windows 2003 server.  Its almost hard to believe since it happens w/ default settings during the MSI installation and the mysql service binary actually segfaults at the "Starting service" step.  This is the "stable" production release as downloaded from mysql.com.  Something like this should be category P1 critical and fixed, IMHO.
[10 Jul 2009 20:07] Sveta Smirnova
greg,

thank you for the feedback.

Please provide Windows error message regarding to "Could not start service" and error log
file.
[12 Dec 2009 3:42] Scott Knestrick
This problem has been a major problem for me.
I have been upgrading several systems from 5.1.30 to 5.1.41 and I found the problem to be a HIDEN directory.  The old data path directory is HIDEN . you must delete via cmd using 
rmdir C:/Documents and Settings/All Users/Application Data/mysql /s

Then remove the MYSQL service instance and reinstall via MySQL Server instance wizard.
[21 Mar 2010 18:25] Benjamin Burnett
I was having the exact same problem on Windows 7. When I first installed, everything worked fine, no problem. I uninstalled and re-installed and the service would never star. After removing the hidden data directory as mentioned in the previous post by Scott Knestrick, it worked perfectly.

[Solution]
Uninstall MySQL from the Control Panel -> Uninstall Programs

Open a command window and issue the command:

     rmdir "C:/Documents and Settings/All Users/Application Data/mysql" /s

Reinstall MySQL

Thanks Scott!
[8 Apr 2010 2:08] Edward Lu
It is a hopeless bug. Please fix it.

Deletion of the "hidden" data directory does not fix the problem. After I deleted it and reinstalled 5.1, the data directory is still in default directory. So I have to shutdown the service and move the data directory and then modify the my.ini to make it work.

MySQL workbench has same problem when choose localhost, it looks into default directory, and never give you a chance to tell it where the server is installed.
[7 Dec 2016 18:38] Yngve Svendsen
Posted by developer:
 
This relates to EOL (no longer supported) versions of MySQL Server. Furthermore, the old plain msi installers have been superseded by the MySQL Installer for Windows. Thus closing.