If you’re having trouble installing MySQL 5.1 on a Windows server, I’d recommend the following process. Don’t skip the first steps that describe the uninstall and removal of the previous install as this seems to clear up most issues. For the uninstall, I’d recommend manually deleting data files. Caution: deleting the data files will delete any data previously entered into MySQL.
1. Remove previous MySQL installs (and remnants)
a. Stop the MySQL service ( Start | Control Panel | Administrative Tools | Services)

b. Remove MySQL using Windows Add or Remove Programs (Start | Control Panel | Add or Remove Programs)

c. Clean up (delete) the data directory (assuming that you don’t have data that you need) c:\documents and settings\all users\application data\mysql

d. Clean up (delete) any remaining directories under program files c:\program files\MySQL\MySQL Server 5.1 (or whatever version you’re using)
————–
That’s it for the removal and clean up. Now, we’ll begin the install.
2. The MySQL install is a two step process: running the installer (.MSI) and then running the MySQL configuration utility (MySQLInstanceConfig.exe). Theoretically, the first step should install the data files and program files and the second step should set up the service, set the root password and start the service. The installer is designed to call the configuration utility automatically. Instead, I recommend running each process separately.
a. Launch the installer from a command-line. Here’s an example shell>msiexec /log c:\install.txt /i mysql-5.1.34-win32.msi
Note: You’ll need to change the name of the .msi file to match the name of the version that you’re installing. If you’re not used to working at the command-line, you’ll either need to change the directory to the location of the mysql installation file or specify the full path. For example, you may need to execute: msiexec /log c:\install.txt /i “c:\Documents and Settings\Administrator\Desktop\mysql-5.1.34-win32.msi”
Continue through the wizard until you reach the final screen which says, “Wizard Completed” There’s a checkbox to “Configure the MySQL Server now”. Uncheck the box and select Finish.

Uncheck the Configure box.
When the install has finished, please check c:\documents and settings\all users\application data\mysql\mysql server 5.1\data . You should see a mysql and test directory.
Also, verify that files have been installed in c:\program files\MySQL\MySQL Server 5.1
You should have a bin, Docs and share folder.
b. Navigate to c:\program files\MySQL\MySQL Server 5.1\bin and launch the MySQLInstanceConfig.exe from a command-line. Here’s an example.
shell>MySQLInstanceConfig.exe “-lC:\mysql_install_log.txt” “
I suggest launching it from a command-line so that you can pass the -l parameter, which will create an install log in case you need to troubleshoot the problem.
Step through the wizard. Make sure to remember the password that you assign in the wizard.
The install should complete successfully.
TROUBLESHOOTING
What if it didn’t work?
1. Check the service from the control panel. Is it running? If so, try to log into MySQL. I’ve seen instances where an error was received, but it completed successfully. If it’s not running, try to start it and please post the complete error message.
2. Check the error log. It’s in C:\Documents and Settings\All Users\Application Data\MySQL\MySQL Server 5.1\data It has an .err extension and you should be able to open it with notepad. Ignore any errors about the innodb plugin not loading. It’s a symptom, not the problem. Look for an error about missing data files or a mismatch in file sizes.
3. 1045 error? It should indicate Password: No or Password:yes. If “yes”, it’s not a port issue, not a firewall issue — it’s a password issue. It’s usually caused by not deleting out the data files from an old install. The password is kept in the data directory and it’s likely that the password you entered during the previous install doesn’t match what you’re entering now. You can either re-install after deleting all the files or try to reset your root password. (resetting root password: http://dev.mysql.com/doc/refman/5.1/en/resetting-permissions.html )
4. Still stuck? In the instructions above, I specified c:\install.txt and c:\mysql_install_log.txt Please check those and post the contents.
Thanks Lee, this uninstall/re-install overview was really handy. I was trying to upgrade, but had missed the InnoDB files hidden in the application data folder – I now have 5.1.35 installed successfully!
Comment by Richard — June 25, 2009 @ 12:14 pm |
Thank you. It is now running!
Comment by Ian — July 1, 2009 @ 3:13 am |
Excellent post, that really helped to resolve a problem trying to re-install. First I was getting an error 1045, then error 0 and finally error 1067.
For Windows Standard Server 2008:
-Removed the MySQL directory from C:\ProgramData (a hidden directory) as well the MySQL directories from ProgramFiles.
-Removed MySQL using the uninstall program option from the Control Panel
-Backed up the registry
-Removed all the MySQL registry entries under Software
-Followed your installation instructions
-Ran MySQLInstanceConfig.exe “-lC:\mysql_install_log.txt” command and the config wizard’s first screen allows you to choose between reconfigure the server or remove configuration > selected remove. This removes the MySQL service cleanly.
-Re-ran the config command and proceeded with the configuration without being prompted to enter the current password (as I had previously), I was just prompted to enter and confirm a new password.
Comment by Joe — July 22, 2009 @ 12:40 pm |
Wow! Thank you for this post!
I’ve been trying to install MySql for an hour now and didn’t have any luck, even after reading this post a few times.
My problem was the the data directory. I’m installing on a fresh Windows 2008 Server and there were hidden files and folders that I couldn’t see (nor search) that had to be deleted.
Look for: C:\ProgramData\MySQL\ and delete that in the first step.
Once I found that folder, I was able to complete the rest of the steps and get MySql 5.1.37 installed.
Comment by ottoradke — August 11, 2009 @ 11:15 pm |
After many guides I still don’t get it to work (it worked, but after update it became a mess). And I actually do not think it is a MySQL problem, but my Server 2003 just won’t accept ANY version of MySQL service anymore. Keeps telling me “starting” so MySQLInstanceConfig will give me the well know error WITHOUT error=0.
Also the server boots much too slow, I need to get my services straithened out I think, or are there any people who could point me in a certain direction?
Comment by Richard — August 15, 2009 @ 8:38 am |
Still does not work. Most frustrating.
One of the errors in the install log file says. “CAUpdateOfflineReg: Error 0x8007006e: failed to load service tag file c\program files\mysql\mysql server 5.1\svctag.xml”. Not sure why this would be as the file exists. The very next line also has the same error and says “failed to get registryUrn”.
The configuration log file says “Could not start the service MySQL. Error: 0″ as its has every other time.
Not sure what to do…may go back to 5.0 and see if that works
Comment by bryan — August 29, 2009 @ 1:01 am |
After all, I just gave up on it.
DO NOT spend too many hours, it’s not worth it. Tried all tips on all forums. If you have a good backup just do a full reinstall. It’s just not a mysql but stupid windows (registry or whatever) issue.
Comment by Richard — August 29, 2009 @ 10:42 pm |
Awesome .. it was so clear and easy thanks a lot for the useful info..
Comment by Porchelvi — October 3, 2009 @ 8:21 pm |
This rocks! Thanks for the good post, it worked the first time.
Comment by spaace — October 4, 2009 @ 2:49 pm |
For apps where compute demand is flat, cloud may still make sense for a variety of reasons. ,
Comment by Settor10 — October 13, 2009 @ 7:23 am |
You’re the man. I was having trouble to reinstall the MySQL…tried the suggestions from couple other sites…still failed…finally yours worked for me…and clear and easy instructions…Thanks.
Comment by Anonymous — October 16, 2009 @ 7:09 pm |
Great post.
Was re-installing because i forgot the password.
And got stuck there.
Thank to this post, saved my life.
Comment by inyo — October 19, 2009 @ 12:39 am |
Um, yes, obviously, but the place we’ll head to next will in all likelihood be smaller. ,
Comment by Roy55 — October 22, 2009 @ 7:32 am |
Obama, imo, is the best vehicle we have to break this travesty wide open. ,
Comment by Barbara93 — October 23, 2009 @ 7:10 am |
Lee,
Thanks for the posting. I struggled with several levels of problems trying to get MySQL to start up as a service on a Windows 2003 machine. I was getting NOWHERE until I finally stumbled upon your post. Following your instructions, the thing installed and is now running as a service.
About the only thing that you suggested that I had not done on many earlier installs was the deletion of the C:\MySQL Datafiles folder.
THANKS !!!
Question: How important was it to have run the two installs from a command line rather than just double-left-clicking the MSI files?
Comment by Joe Hall — December 12, 2009 @ 10:18 pm |
Regarding running these files from the command-line, it’s only necessary to generate log files. Otherwise, double-left-clicking on MSI files is equivalent to running from the command-line.
Comment by Lee Stigile — December 14, 2009 @ 6:41 pm |
thanks for the information. it worked for me.
Comment by vad — March 13, 2010 @ 4:40 pm |
thanks.
originally i was getting the message “error 1067 the process terminated unexpectedly”, when trying to start the service “mySQL” in the service manager.
also originally i was getting the message “can’t connect to mySQL server” when running a connection test. (this is of course b/c the mySQL service wasn’t running – wouldn’t even start).
this is the sure way to solve these basic bugs.
thanks a lot.
Comment by joshua — March 31, 2010 @ 5:12 pm |
Dear Lee Stigile,
thank you for this ‘how to’, really helped me out when I almost gave up to fix my problem… all around I coudn’t see the data folder ’cause it was hidden… glad that finally done with that problem.
Comment by Tommy_T — May 21, 2010 @ 2:06 pm |
Thanks for the tips, It works for Windows 7 as well except the location “c:\documents and settings\all users\application data\mysql” is no longer available. I went here and deleted everything “MySQL”. Go To “C:\Users\All Users”, “C:\ProgramData”, and “C:\Program Files”. I deleted all of these files and had NO problem reinstalling. Thanks Big time!!!
Comment by matthew Stephens — May 29, 2010 @ 8:39 pm |
If somebody have still prouble with starting services and always gets message “error 1067 the process terminated unexpectedly”. This proble is maybe with encoding file “my.ini”, which is in folder “MySQL Server 5.1″. This file is in UTF8 and if path in Documents and Setting or in Program Files contains characters with accents Windows cannot start service. In my case the problem was with path to datadir=”C:/Documents and Settings/All Users/Data aplikací/MySQL/MySQL Server 5.1/Data/”
Solutions is convert this file to corect encoding, in my case to ANSI. Then start MySQL service with services.msc. Now the service should works, but yet you must change password with commad “mysqladmin -u root password “.
Solutions (in Czech language) is here: http://slavkuv.net/pc/rady-internet/could-not-start-the-service-mysql/
Comment by Jirka — June 22, 2010 @ 5:08 pm |
You are a genius – thank you thank you! worked perfectly when i deleted the directory in application data for mysql…
Comment by Conor — July 15, 2010 @ 1:05 am |
Thank u very very much…………….I was trying from evening………….My will be held tomorrow………..And it started again…………….Once again thanq…………….
Comment by Hari Om — August 13, 2010 @ 4:14 pm |
Thank u very very much…………….I was trying since evening………… My exam will be held tomorrow………..And it started again…………….Once again thanq very much…………….
Comment by Hari Om — August 13, 2010 @ 4:17 pm |
wow great!
Comment by melisa — September 8, 2010 @ 1:14 pm |
great information sharing.. Thank you very much
Comment by david — November 17, 2010 @ 5:20 pm |
Life saver! MySQL finally works. Was using windows 7 and the problem was i hadnt deleted ALL of the old files before installing MySQL.
1. Remove all files a and folders from old installations as stated above
Do a search in the users folder and get all mysql folders there. Also the one in “C:\ProgramData\MySQL\” which is a hidden folder.
2. I used CC cleaner and WinASO to remove all registry entry’s
Then install MySQL and run the instance configuration.. BOOM
Note: When installing a new instance you should not see a field to enter the original password. If you can youve f****d up ^^.
Comment by Jethro L - Computer Science — December 8, 2010 @ 11:55 am |
Ty sir, this tutorial had resolve my problem. Very detailed.
Cheers ^___^
Jep
Comment by jep — December 13, 2010 @ 8:56 am |
I recently found this website that I want to share with everyopne as they were a remarkable help when I was
working on a recent project. I needed to know how to do some stuff in PHP and they were able to provide
a tutorial sepcifically tailored to my needs. It was amazing.
TeamTutorials
I recommend you hit them up and check them out if you need assistance.
Comment by Needitant — February 20, 2011 @ 4:09 pm |
Thank You
Comment by Manoj K M — July 20, 2011 @ 3:14 am |
Thnx for the tutorial. After installation, We need to Launch mysql_embedded at the mysql folder.
Version 5.5
OS – Xp
Comment by Anonymous — October 27, 2011 @ 5:34 pm |
Thanks this tutorial had resolve my problem
Comment by ılıll♥♫♪BHARATHI D♪♫♥ılıll — October 31, 2011 @ 1:57 pm |
MySQL Windows Install Troubleshooting Managing Data is an outstanding share. Thanks a lot for this article.
Comment by jocuri cu bile rosii — January 5, 2012 @ 7:21 am |
Thank you! A troubleshooting guide that actually worked!
Comment by Anonymous — January 7, 2012 @ 9:41 pm |
thank you brother it helped me a lot. Precisely this link, http://dev.mysql.com/doc/refman/5.1/en/resetting-permissions.html
Comment by Aziz Khakim blog's — January 26, 2012 @ 4:36 am |
unable to connect to mysql on windows xp.please help.error no is 2003
Comment by samii — April 29, 2012 @ 4:12 pm |
Hello,I love to read more on this topic. I appreciate you for publishing MySQL Windows Install Troubleshooting Managing Data.
Comment by private investigator london — May 12, 2012 @ 1:23 pm |
Mehdi
I love u i do that
Comment by Anonymous — July 17, 2012 @ 12:40 pm |
I know this an older post but this is the only thing that helped me with my 5.5 installation! I had previously installed 5.1 and tried to upgrade and ran into issues. I used your directions and removed both versions – 5.1 and the 5.5 I had tried to install. It worked like a charm. I had struggled with this mess for hours too! Thank you so much for all of your help!
Comment by Elizabeth — November 17, 2012 @ 3:39 am |
Good post! We will be linking to this great article on our site.
Keep up the good writing.
Comment by Susanna — November 29, 2012 @ 10:32 am |
Man, thabks so much….you saved a day!!!!
Comment by Tope Davids — December 10, 2012 @ 1:02 am |
thanks Lee Good work!
Comment by Anonymous — December 17, 2012 @ 2:30 pm |
Sitios de comparadores en Europa están ahora aplicando un poder significativo, especialmente en los seguros de automóviles.
Esto preocupa en Inglaterra a aseguradores de coches, que les preocupa que el sector deje
de ser rentables porque el precio es el indice principal.
En Australia, sitios de comparación están creciendo
en número, pero su papel ha dividido a la industria.
Algunas aseguradoras ven como un camino para la venta
de productos y tentar a clientes a adquirir un seguro.
Otros se oponen con vehemencia a él por razones que se cortan las ganancias.
Comment by rastreatorelcomparador.weebly.com — January 4, 2013 @ 7:13 am |
Si eres uno entre los innumerables de navegantes que se avergüenzan de reconocer que aun posee una dirección de Hotmail, el día ha llegado.
En serio, puede migrar al fantastico nuevo servicio de correo electrónico de Microsoft Outlook y comenzar
a utilizar sus servicios inteligentes para combinar con tus contactos de Facebook y
limpiar todo el spam acumulado en los pasados años.
Comment by outlook — January 5, 2013 @ 6:45 am |
You really make it seem so easy with your presentation but I
find this matter to be really something that I think I
would never understand. It seems too complicated and very broad for
me. I am looking forward for your next post, I will try to get
the hang of it!
Comment by juegos de sonic — January 6, 2013 @ 6:23 pm |
Thanks for your personal marvelous posting! I actually enjoyed reading it, you could be a great
author.I will make sure to bookmark your blog and will
come back from now on. I want to encourage you
to continue your great job, have a nice holiday weekend!
Comment by work from home jobs no fees — January 12, 2013 @ 9:51 am |
I really like looking through an article that
will make people think. Also, thanks for permitting me to
comment!
Comment by Augusta — May 3, 2013 @ 6:26 am |