JavaScript Editor Js editor     Website development 

Main Page

Previous Page
Next Page

Installing MySQL on Windows

MySQL will run on most Windows operating systems (specifically those that are at least 32-bit, such as Windows 95, 98, Me, NT, 2000, and XP). If you're using an NT OS such as Windows NT, 2000, or XP (either the Home or Professional version), you can run MySQL as a service, as I'll demonstrate in the next chapter. For my example here, I'll be installing the latest stable release of MySQL on Windows XP Professional.

There are two primary ways of installing the MySQL software on a Windows operating system: using a precompiled distribution or compiling your own binary from the MySQL source files. The former approach is significantly easier than the latter and will be the technique I use here. When you get to the MySQL downloads page, you'll see three items listed for Windows: Windows Essentials, which is the Standard binary; just Windows, which is the Max version; and, Without Installer, which is the source code. The first is the smallest and will work for most people. The second has all the extra bells and whistles.

Once complete, MySQL will be installed in C:\Program Files\MySQL\MySQL Server x.x, where x.x represents the release series installed. This is true as of MySQL 5.0. Prior to that, MySQL was installed in C:\mysql, by default. In either case, Table 1.1 indicates the resulting layout of folders.

Table 1.1. After installing MySQL, you'll have these folders (all found within the main MySQL folder).

MySQL Layout on Windows




All applications


Databases and logs




Sample programs and scripts


Header files


Code libraries


Useful scripts


Error message files


Benchmark utilities

Finally, I'll point out that these instructions are correct as of the writing of this book. MySQL has frequently changed the installation process over the years. One release may have an entirely different installation process and result from the next. If you have a problem with these instructions, check the version of the manual that matches the MySQL version you are installing.

To install MySQL on Windows:

Download the Zip file from the MySQL Web site.

Start by pointing your browser to Then click the name of the version you'll want. As of the time of this writing, the most current stable release of MySQL is version 5.0.18.

On the next page, you'll be able to choose which distribution you want (Figure 1.2). MySQL recommends the Windows Essentials, but I'd recommend the full version (called just Windows) if you want to learn it all.

Figure 1.2. Choose between the Essentials or the complete version of MySQL.

Unzip the downloaded file, if necessary.

The complete MySQL package comes as a Zip file that must be unzipped (if you don't already have a Zip application, there are free ones availablejust search Google or It doesn't really matter where you choose to unzip the files in this step.

At the time of this writing, the Essentials version of the installer is downloaded as a Microsoft Windows Installer (.msi) file that does not require unzipping.

Run the setup.exe or .msi application by double-clicking the file.

Depending upon which file you download, you should now have either an executable (called setup.exe) in the unzipped folder or a Microsoft Windows Installer (.msi). In either case, just double-click the file to begin the installation process.

If you are using a version of Windows NT, you must be logged in as an administrator-level user with the permission to install software.

On the second installation page, select the installation type: Typical, Complete, or Custom (Figure 1.3).

Figure 1.3. Choose an installation type, based upon what best suits your situation and knowledge.

Naturally, the Typical installation should be fine for most users. If you opt for the Custom Setup, click an item and view the description in the right-hand panel (Figure 1.4) to determine if you need that particular item. You absolutely must install the MySQL Server, and you should install the Client Programs.

Figure 1.4. You can customize what all is installed, including extra scripts and examples.

Click your way through the rest of the installation process and, if you want, sign up for a account when prompted.

You don't have to sign up, but doing so has its benefits. For starters, an account lets you post at (a community support forum), subscribe to MySQL newsletters, and the like.

Opt for configuring the MySQL Server now when prompted (Figure 1.5) and click Finish.

Figure 1.5. After installing MySQL, choose to jump straight into the MySQL configuration wizard.

The installation process is now complete, which means you should set up how the MySQL server runs. The installer will take you over to the configuration wizard for this purpose. This topic is discussed in the next section of the chapter, so please read on.


  • The recommendation is that MySQL be run on Windows using the NTFS file system (not FAT or FAT32).

  • MySQL suggests a minimum of 200 MB of available disk space, but how much disk space is actually required will depend upon how many databases you have, how much you use indexes, and how much data you store. If space is an issue, download and install the Essentials version of MySQL, not the complete.

Previous Page
Next Page

JavaScript Editor Js editor     Website development