MySQL is easy to install on Windows and the installation is almost the same across all versions of Windows.
There are several decisions to make during the installation process. The following list contains decisions where you may use something other than the default.
- Alternative installation methods
- 32 bit or 64 bit
- Server type
- InnoDB or MyISAM
- InnoDB storage location
Alternative installation methods
The main reasons for a manual installation of MySQL are to learn about the MySQL installation and installation options. You might consider saving time by installing MySQL as part of a package including the Apache Web server and PHP. Here are alternatives recommended by people who use these packages.
- Zend Server Community Edition for Windows, Linux, and the Apple version of Unix. Thank you to Val Paliy for suggesting this alternative.
- XAMPP for Windows, Linux, and the iPad iMac.
- WAMP for Windows.
Download MySQL from dev.mysql.com/downloads. Select the MySQL Community Server then the the Generally Available (GA) Release, in this case 5.1.
32 bit or 64 bit
You can choose 32 bit or 64 bit versions. I used a 64 bit version because I am using Windows XP 64.
MSI or ZIP
You can choose between the MSI versions for easy installation or the ZIP versions for manual installation. Use the MSI version.
The essentials or a developer version
You can choose a regular version, the Essentials, at 30 MB or a bloated 100 MB version for developers. The bloated version contains documentation that will be out of date by the time you read it all. I chose:
Windows (x86, 64-bit), MSI Installer Essentials - Recommended
Download the file, mysql-essential-5.1.47-winx64.msi, to a directory away from your c: drive. Keep a spare disk, perhaps a USB disk, for all your downloads of the software you install on your computer. You can then use the software on other computers.
Switch to your administrator login. XP 64 lets me work in the administrator login without logging out of my regular user session. This is safe for an initial installation. Log out of you other user accounts before an upgrade because those accounts could be using an application that uses the software you are upgrading.
Start the installation
Start the installation by double clicking on the installation file, mysql-essential-5.1.47-winx64.msi, or you can right click then select Install. you will see the following Welcome screen. Select the
You will see the following Setup type screen showing three options, Typical, Complete, and Custom. We will use custom this time around to see all the options. Custom will show the defaults used in Typical and you may choose to use them in the future. Complete is equivalent to selecting everything in the subsequent Custom setup screen. Select Custom then Next.
The following Custom setup screen lists a few options. One has undisplayed sub options so I opened that list before taking the screen shot. The defaults are fine for what we want. We could use the Typical option for this part.
The ready to install screen lists the selected options and offers the Next button. Select Next.
The MySQL installation process will then display some advertising pages, two in 5.1.47. Select Next at each advert.
The following Wizard completed screen shows two options, Configure the MySQL server now and Register the MySQL server now. Switch off the registration option then select Finish.
Server instance configuration
This is the point where you configure the MySQL server that will run on your machine. We set it up as a service so it is running all the time and can be used by any application.
The Server instance configuration wizard screen has only one useful option. Select next.
The Server instance configuration type screen shows two options, Detailed configuration and Standard configuration, plus the Next button. Use the default Detailed configuration to see all the questions relevant to your installation. Select Next.
The next step is to select the server type. The choices are Developer machine, Server machine, and Dedicated MySQL server machine. We will not use Dedicated MySQL server machine.
Developer machine is a good choice for smaller laptops short on memory.
Server machine is the right choice for fast desktop machines with lots of memory and will let you test Web sites with lots of data. When you are working on an existing sites, you can copy the whole database to your machine and run lots of intensive testing using an automated testing tool.
InnoDB or MyISAM
The next choice is the type of database engine. MyISAM is the original MySQL database engine and you will always need MyISAM for Web work. InnoDB was the alternative for transactional updates. Now they are both in the same package so try both. MyISAM is faster in some situations and offers more flexibility for large databases. InnoDB is limited in size by cramming everything into one file. You will not see a difference in test sites. A site with millions of users will need the table splitting and clustering options in MyISAM.
The following screen shows the database usage options. The first choice installs InnoDB and MyISAM. The second choice installs only InnoDB. The third choice installs only MySQL. Use the first choice, the default, because you can experiment with both InnoDB and MyISAM.
InnoDB storage location
InnoDB stores everything in one file and needs a location for the file. Select the location. The default is fine for a computer with a single disk. When you have more than one disk, you usually want to move the data files away from the system disk for better performance and easier backups.
The following screen shows the drive selection changes from c to h. MySQL proposes a directory name of MySQL Datafiles. I can use that directory and copy old MyISAM databases into the directory because the MyISAM engine automatically recognises all the databases in the directory.
The Server instance concurrent connections screen shows three choices, Decision Support (DSS)/OLAP, Online Transaction Processing (OLTP), and a Manual setting. The default, Decision Support, is fine for our requirements. Select Next.
You can choose to allow access to MySQL through TCP/IP. If your local network is protected by a firewall then allow TCP access so you can experiment with access across the network. In most cases you do not allow TCP access because your database is behind a Web server and the Web server provides access using Web services.
You always use Strict mode. Occasionally you might need something else to test a very old application against a very old database but you usually do that on a separate test machine because you will need lots of very old software.
Default character set
The character set choice in the following screen is just a convenience because you can change the choice for each database. Choose Best Support For Multilingualism because you will need UTF8 for most new projects. Select Next.
Install as a service
Install Windows as a service so it is automatically started and available everywhere. Do not worry about the path option because you should never need the command line with modern software. Select Install As Windows Service then Next.
You need a password to access MySQL. Enter a password in the security options screen, shown in the following screenshot, and select Next.
Ready to execute
The following screen shows the start of the execution phase. The screen will step through the items shown on the list. Some will take several seconds with no indication of progress. Select Execute.
The final screen in the installation is the following screen where you select Finish to finish the installation.
The following screenshot shows the menu entries produced by the MySQL installation. Delete the registration entry because it is a waste of space. Surely the installation procedure can remember your choice to not register and leave the registration entry off the menu.