Install and Configure MySQL 5 on Windows

Categories:

The next step is to set the option that best suites your estimated conccurrent connection usage. This really depends on what applications you'll be using, and how many. You need to be mindful of this limit as many MySQL buffer/cache settings are per connection based, so setting this too high may leave your server open for a memory usage blow out. As a general purpose database server for web applications I suggest using the Decision Support (DSS)/OLAP option which sets the concurrent connection limit to 20 which is pretty safe. Once you have made your selection click the Next button at the bottom as shown below in figure 11 to continue.


figure 11

The next page in the configuration wizard allows you to enable/disable networking support, and enable/disable the MySQL strict mode. Ensure that you have the Enable TCP/IP Networking option checked, but I actually recommend that your uncheck the Enable Strict Mode option even though it is on by default and recommended in the configuration wizard. This is because a lot of web applications do not work with MySQL running in strict mode (just do a Google search on it), so unless you have a specific reason for enabling it I suggest leaving it unchecked. Once you have made your selection click the Next button at the bottom to continue as shown below in figure 12.


figure 12

Here you can set the default character set used by MySQL. Leave it as the default Standard Character Set unless you require otherwise. This does not disabled other chracter sets, and most applications that require a specifc character set will define it in their installtion process. Click the Next button to continue as shown below in figure 13.


figure 13

In this step we set the Windows specific options which include running MySQL as a service and adding MySQL to the system path. Ensure that the Install As Windows Service and Launch MySQL Server Automatically options are checked. I also recommend that you check the Include Bin Directory in Windows PATH option so that you can execute the MySQL tools from anywhere when using the command line. This can be handy when creating automated scripts for backups, etc. Once you've made your selection click the Next button at the bottom as shown below in figure 14.


figure 14

This step is very important as here you set the root password. The root account is equivalent to the Windows administrator account, so be sure to set a strong password (alphanumeric & atleast 6 characters) that you are going to remember. I don't recommend checking the Enable root access for remote machines option if this server is going to be exposed to the Internet, nor to I recommend checking the Create An Anonymous Account option. Click Next to continue on to complete the configuration wizard as shown below in figure 15.


figure 15

After setting the password you'll be presented with a page confriming your settings. Click the Execute button at the bottom and the configuration wizard will go ahead and implement your settings. Once completed you should be presented with a page as shown below in figure 16 showing that everything was sucessful and that the MySQL service is now using the new settings. Press Finish to complete this configuration wizard and exit.


figure 16

That's it, all done! You now have your MySQL server up and running and you can start using MySQL based applications. All your MySQL settings are stored in a file called my.ini in the root of your MySQL installation, and you can reconfigure your server at any time by editing this file directly or running the configuration wizard again. If you are going to use PHP applications with MySQL, be sure to check out my guide on installing PHP 5 on IIS in 5 simple steps. Be sure to check back for new articles on how to create & delete users and databases, assign permissions and other general MySQL administration task. Also keep an eye out for future articles that will cover the basics of MySQL performance tuning. As always, if you need any help please feel free to ask questions in the forums (registration required).

Comments

Anonymous's picture

Installing on one server

Hi there,

A question from a web server novice to those of you with much more experience than me.

I have a fairly low spec web server (0.35GHz Xeon, 512MB RAM) running Windows Server 2008 Web Edition. I am only hosting a few websites currently (6 at the time of writing) and none of these do much more than serve a few static pages. I am just starting out but plan, as I learn, to expand functionality.

I want to install hMailServer but first want to install MySQL. Does anyone have any advice regarding putting everything on a single server (iis7, MySQL, hMailServer)?

The reason I ask is that one popular tutorial (http://learn.iis.net/page.aspx/353/install-and-configure-mysql-for-php-applications-on-iis-7-and-above/) on installing MySQL kicks off by recommending that you install it on a separate machine to avoid resource contention. This is beyond my budget and scope currently as all I am doing is using these few websites to teach myself about running a web server and mail server environment.
Perhaps in the future as my knowledge grows, my ability to upgrade my server/servers will grow too, but for now I am looking at low spec and low traffic.

Any advice? All greatly appreciated.

Kind Regards,

Matt.

admin's picture

Internal DB should be fine

Hi Matt,

In an ideal world you would install MySQL on a separate server to IIS/PHP, however it most certinaly is not a requirement or even that beneficial (performance wise) given an adequately spec'd server.

Unfortunately your systems specs are going to be your major limitation. I know this very specifically as I used to use a system with a Pentium II 350MHz CPU and 256MB of RAM for testing some years back, however found it was just not up to the task. Honestly I would advise you look at upgrading those hardware specs. I just saw a Pentium 4 3.2GHz, motherboard and 1GB RAM on Ebay for $20, which is perfect for a low budget lab environment. To get an idea of how much difference this would make have a look at this article I wrote some years back where a PII 350MHz CPU and a P4 3.2GHz CPU are compared.

If a hardware upgrade (even done cheaply) is simply not possible no matter the price, then I would not advise you to install MySQL on your existing server. What you can do is use the SQL CE database engine that is built into hMailServer. It will not scale like MySQL or MS SQL or have the same array of support tools, but should be ok for a learning environment.

Anonymous's picture

I got problem while installing

I count not start the services while installing. i dont know why. what is solution for this. Please tel me what is the solution for this. you can reach me by this mailid

Anonymous's picture

Error connecting to Localhost

Using Windows 7 and IIS 7.

Installed the MySQL Installer for Windows version 5.5. And went to the configuration page. Every step is fine.. except the last one.. i cant start the server...

I am getting the error.. Cant start the Server on localhost....

Please help me on this one.

Brashquido's picture

Ping localhost?

From a command line ping localhost . What reply do you get? In your MySQL config, change localhost to 127.0.0.1 and see if it starts.

----------------
Dominic Ryan
6 x Microsoft IIS MVP, MCSE, MCSA
IIS Aid owner/webmaster

Anonymous's picture

processing configuration

figure 16 start service error

Brashquido's picture

MySQL upgrade?

I've seen that issue before when doing an over the top upgrade of MySQL. I've also read that changing the account that the MySQL service is run with from Network Service to Local System works after a reboot, however by doing this you are granting the MySQL service a lot more privileges to your system.

----------------
Dominic Ryan
6 x Microsoft IIS MVP, MCSE, MCSA
IIS Aid owner/webmaster