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

Running MySql on a server and accessing it from clients

I Have installed MySql on a powerful server running windows 2003 OS and was trying to access through clients,but its not connecting.I need information on this settings so as to what to be modified and set to run from clients
thanks
Raj

Brashquido's picture

Enable access from remote machines

Hi Raj,

To allow your client machines to connect you'll need to tick the "enable access from remote machines" checkbox as shown in figure 15.

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

Anonymous's picture

Nick

I have the same problem discribed in this response: " Nice tutorial ... but the Configuration doesn't work!"

The author of that response said something needed to be tweeked in order to get pass the problem.
Can anyone help?
thanks.

Brashquido's picture

Are you upgrading, or

Are you upgrading, or reinstalling over an existing install of MySQL?

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

Anonymous's picture

Response to " Nice tutorial ... but the Configuration ..."

Hi Guys,
MySQL noob myself, but I think I've seen the issue you are describing when I performed an install-uninstall-install with MySQL.

I believe what you are experiencing is the result of certain MySQL files not being removed completely. As a result, you are being asked for the old/current pw as well.

I was able to get things to work by using the remove utility in the mysql server instance config wizard, removing the instance and then installing mysql again.

Hope that help!

mysqlpadawan

Anonymous's picture

ReInstalling Password Problem

To ReInstall you must first use the Setup.exe and I believe it is the second GUI window and use the Remove radio button. After it says everything is removed, it is not ! You must manually delete C:\ProgramData\MySQL. I emptied my Recycle Bin, then, When ReInStalling using Setup.exe again, it does not ask for the old or current password. Make sure you write down what the new one is that you are setting. On a new command line window use C:\>mysql -u root -p and it should ask you for a password which should be the new one you just created. Hope this helps.

Anonymous's picture

MySQL ODBC Connector

Hi Dominic,

I just upgraded to the latest version of MySQL i.e. 5.1 from 4.0.26 and ran my backup SQL scripts which were imported without any issues.

I do however have version 3.51 of the ODBC Connector installed. I'm not sure why however one of the ASP (Active Server Pages) applications now no longer returns any records after the upgrade to version 5.1

Would you know why? Should I upgrade the ODBC Connector to version 5.1?

Michellea

Brashquido's picture

Checked your DSN?

I assume you have checked your DSN to ensure it is still connecting to the server OK? I'm pretty sure you can run the 3.51 and 5.1 connectors side by side, so that might be an option.

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

Anonymous's picture

MySQL ODBC Connector

Hi Dominic,

I have checked the DSN entries and they are connecting fine and I did attempt to run version 5.1 alongside 3.5 but Windows 2003 doesn't permit it. It returns the message that I have to uninstall the previous version.

Brashquido's picture

Look to the SQL

That is weird. I have 5.1 and 3.51 installed along side each other on my XP box, obviously not the same for 2003. When I first upgraded from MySQL 4 to MySQL 5 I can remember a lot of applications had issues working when strict mode is enabled. Not so much of an issue now I think, but it is enabled by default so might be something to check. Other things to do would be to enable the debug log in ODBC, and error log in MySQL. Also, have a look at the SQL statement(s) inside the ASP itself, and see if you can run it in an SQL window in PHPMyAdmin or similar.

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