Wednesday, June 24, 2009

Step-by-Step guide for Installing MySQL on Windows

You can download the MySQL database from the MySQL website http://www.mysql.com by clicking on the downloads tab. Scroll down to the MySQL database server & standard clients section and select the latest production release of MySQL, 5.1.35 at the time of writing.

Installation of MySQL Server


Unzip the setup file and execute the downloaded MSI file. Follow the instructions below exactly when installing MySQL Server:



Click on the "setup"




Perform a typical installation








<!--[if !vml]--><!--[endif]-->


Check box to configure MySQL Server

If you checked the Configure the MySQL Server now check box on the final dialog of the MySQL
Server installation, then the MySQL Server Instance Configuration Wizard will automatically start.
Follow the instructions below carefully to configure your MySQL Server to run correctly with
EventSentry.




Select Detailed Configuration



I was installing it on my local machine where other applications & tools are running I decided to opt "developer machine" but it is recommended that you use a Dedicated MySQL Server Machine for your MySQL database, if this is not an option then select "Server Machine".

If you selected Dedicated MySQL Server Machine and your MySQL service does not start after the wizard completes, then try to re-run the wizard (or re-install) MySQL, but this time select the Server Machine option.



I have checked "Multifunctional databases" as I wanted MyISAM as default storage engine but if you want you can select "Transactional Database Only", this will make sure that InnoDB is the main storage engine. If you have checked 3rd option then only myISAM engine would be available



Select the drive where the database files will be stored.
Select the drive on the fastest drive(s) on your server








It is recommended that you leave the default port 3306 in place, however
EventSentry will also work with non-standard ports if necessary.








It is highly recommended that you run the MySQL Server as a Windows
service(you can disable this if you want to start it manually whenever required) and include the binary directory in the search path.



Specify a secure root password, you may want to check the box Enable root access
from remote machines if you plan on administering your MySQL server
from your workstation or other servers.


If you are getting an error message after clicking the Next button, then please enable port 3306
in the Windows XP Firewall Settings






Done!!!

But if you are installing MySQL on a Windows XP workstation, or any other computer that has a firewall enabled, and the wizard fails with an error message similar to the one shown below (Can't connect to MySQL server on 'localhost'), then you will have to exclude the MySQL daemon from your firewall configuration



On Windows XP, you can exclude MySQL from the firewall by following the steps below:
1. Navigate to Start -> Settings -> Control Panel -> Windows Firewall




2. In the resulting dialog, enter the information as shown in the screenshot




After clicking OK twice, return to the MySQL error message and select Retry. MySQL should now be able to create the instance correctly.
<!--[if !vml]--><!--[endif]-->

25 comments:

Brenda said...

I am trying to install MySQL and for some reason it is not completing the task. I get the message start service failed. This is in the last window. It has a red x on start service. Help

Brenda said...

I am trying to install MySQL and for some reason it is not completing the task. I get the message start service failed. This is in the last window. It has a red x on start service. Help

Umesh Shastry said...

Could you check the MySQL error log (file should be in MySQL datadir)and see what it is reporting? also try to install it in C:/mysql or D:/mysql and try to avoid the space between installation path i.e c:/program files

Thanks,
Umesh

breeze1974 said...

In the last step of instalation the " Start service " is crossed in red and not ticked.
The error message is " Cannot create Windows service for MySQL.Error: 0

Umesh Shastry said...

make sure there isn't any space between your directory name such as "program files" ..instead make sure you install it on c:/mysql or D:/mysql etc

Umesh Shastry said...

Pls take a look on this post.. it may help you in resolving your installation issue

http://ushastry.blogspot.com/2009/07/cannot-create-windows-service-for.html

Anonymous said...

Thank you Umesh!!! You saved my day!
-Kim

Sridevi said...

Hi Umesh,

But we don't have the option to change the installation directory.. (to put the c:\sql directory).
Please advise how to do this ?
Thanks in advance.
--Sridevi (snanubala@gmail.com)

Sridevi said...

Hi Umesh,

But we don't have the option to change the installation directory.. (to put the c:\sql directory).
Please advise how to do this ?
Thanks in advance.
--Sridevi (snanubala@gmail.com)

Sridevi said...

Hi Umesh,

But we don't have the option to change the installation directory.. (to put the c:\sql directory).
Please advise how to do this ?
Thanks in advance.
--Sridevi (snanubala@gmail.com)

Umesh Shastry said...

For that you have to perform a custom installation rather than typical installation(second screen - check custom installation & change the default path to whatever you ant say c:/mysql). Let me know if you need any assistance regarding this.

akiles said...

The tutorial is great!!!

No problem i have installed mysql

Thanks ushastry

Regards,
akiles

Arun Veer Singh said...

hi umesh,
i am trying to install mysql 5.5 & have tried everything mentioned in ur blogs...but i got stuck on the last window, tick mark comes on first 2 points n after that nothing happens...

please suggest something..

Thanks
Arun

Umesh Shastry said...

Hi Arun, Is it a fresh installation of MySQL5.5 or you are trying to upgrade from existing? if you are upgrading then please remove the MySQL service and then retry the installation.

Please let me know how it goes otherwise would send you the you exact step on Monday/Tuesday once I'm back to work.

Anonymous said...

http://bugs.mysql.com/bug.php?id=60518

your solution didn't work Umesh.

Adding port manually to firewall, can't start the mysql service from 'services'.

Once installed, mysql is stuck on reinstall, uninstaller doesn't uninstall properly.

Anonymous said...

Hi Umesh,

I am trying to install MySql for the first time from "mysql.com > downloads > 5.0 > Windows (x86, 32-bit), ZIP Archive". I can't locate the "setup.exe" or ".msi" file to start installation. can you help please?

Thanks
Shakil

Umesh Shastry said...

Yes, looks like only *.zip available for 5.0.x, suggest you to go for GA of 5.1.x series or 5.5.x instead of 5.0. Latest GA would have all the bug fixed compared to 5.0 series.

http://dev.mysql.com/downloads/mysql/5.1.html
http://dev.mysql.com/downloads/mysql/5.5.html

If you still want to go ahead with 5.0, better check MySQL mirror sites or Google..

Anonymous said...

Hello Umesh,

Thank you so much for your prompt response. I will go home and try your suggestion.

I will follow up with you tonight.

Thanks a lot again.

Shakil.

Anonymous said...

THANK YOU VERY MUCH SIR !!! THE TUTORIAL IS BRILLIANT I INSTALLED IT :)

Sarang said...

Sir can you please let me know the steps for mysql upgradation on window server in details..

Umesh Shastry said...

Hello Sarang,

Please follow the steps outlined in the manual for your specific version:


http://dev.mysql.com/doc/refman/5.0/en/windows-upgrading.html

http://dev.mysql.com/doc/refman/5.1/en/windows-upgrading.html

http://dev.mysql.com/doc/refman/5.5/en/windows-upgrading.html

http://dev.mysql.com/doc/refman/5.6/en/windows-upgrading.html

Anonymous said...

Thankyou Umesh,your steps guidance helped me a lot.........

Ayesha Sharma said...

very informative.. Thanks.
Have a look at this link http://www.etechpulse.com/2012/10/qick-reference-guide-for-my-sql.html

Dashing AaDi said...

mysql 5.6.14 win32 good post nice work admin..keep it up:)

QUIZVOOK said...

Good Work brother thanks a lot for sharing with us...

Post a Comment