Installing MySQL on Windows

The MySQL installation process on Windows is also quite simple?the developers from MySQL AB have packaged up everything you need in one zip file with a setup program! Once you download the zip file, extract its contents into a temporary directory and run the setup.exe application. After the setup.exe application installs the MySQL server and client programs, you're ready to start the MySQL server.

The following steps detail the installation of MySQL 4.0 from MySQL AB on Windows, and show you what you can expect if you install MySQL in a Windows 95/98/NT/2000/XP environment for testing and development. Many users install MySQL on personal Windows machines, to get a feel for working with the database before deploying MySQL in a production environment.

  1. Visit the MySQL-Pro 4.0 download page at and find the Windows section. You want to download the file under the "Installation files (zip)" heading rather than the one under the "Cygwin downloads (tar.bz2)" heading.


    If you have the tools and skills to compile your own Windows binary files, select the Cygwin source download and follow the instructions contained in the source distribution.

  2. Clicking the Download link will take you to a page of mirror sites. Select the mirror site closest to you, and download the file. It is a large file, so you may be waiting awhile, depending on your connection speed.

  3. Once the zip file is on your hard drive, extract its contents to a temporary directory.

  4. From the temporary directory, find the setup.exe file and double-click it to start the installation. You will see the first screen of the installation wizard, as shown in Figure 1.1. Click Next to continue.

    Figure 1.1. The first step of the MySQL installation wizard.


  5. The second screen in the installation process contains valuable information regarding the installation location (see Figure 1.2). The default installation location is C:\mysql. If you plan to install MySQL in a different location, this screen shows you a few changes that you will have to make on your own. The information on this screen is also important for Windows NT users who wish to start MySQL as a service. Read the information and note anything relevant to your situation, then click Next to continue.

    Figure 1.2. Step 2 of the MySQL installation wizard. Note any relevant information before continuing.


  6. The third screen in the installation process has you select the installation location (see Figure 1.3). If you want to install MySQL in the default location, click Next to continue. Otherwise, click Browse and navigate to the location of your choice, then click Next to continue.

    Figure 1.3. Step 3 of the MySQL installation wizard. Select an installation location.


  7. The fourth screen asks you to select the installation method?Typical, Compact, or Custom (see Figure 1.4). The Custom option allows you to select elements of MySQL to install, such as documentation and help files. Select Typical as the installation method, and click Next to continue.

    Figure 1.4. Step 4 of the MySQL installation wizard. Select an installation type.


  8. The installation process will now take over and install files in their proper locations. When the process is finished, you will see a confirmation of completion, as in Figure 1.5. Click Finish to complete the setup process.

    Figure 1.5. MySQL has been installed.


There are no fancy shortcuts installed in your Windows Start menu after an installation of MySQL from MySQL AB, so now you must start the process yourself. If you navigate to the MySQL applications directory (usually C:\mysql\bin\ unless you changed your installation path), you will find numerous applications ready for action (see Figure 1.6).

Figure 1.6. A directory listing of MySQL applications.


The winmysqladmin.exe application is a great friend to Windows users who are just getting started with MySQL. If you double-click this file, it will start the MySQL server and place a stoplight icon in your taskbar.

When you start WinMySQLadmin for the first time, you will be prompted for a username and password (see Figure 1.7). The application will create the initial MySQL user account on a Windows system.

Figure 1.7. Creating the initial MySQL account.


When you are finished creating the account, or whenever you right-click the stoplight icon in your taskbar, the graphical user interface will launch. This interface, shown in Figure 1.8, provides an easy way to maintain and monitor your new server.

Figure 1.8. WinMySQLadmin started and ready for action.


WinMySQLadmin will automatically interpret environment information, such as IP address and machine name. The tabs across the top allow you to view system information and edit MySQL configuration options.

For example, if you select the Variables tab, as shown in Figure 1.9, you can also view server configuration information. This information is similar to the output of the MySQL SHOW VARIABLES command.

Figure 1.9. Server configuration information.


To shut down the MySQL server and/or the WinMySQLadmin tool, right-click again on the stoplight icon in your taskbar and select the appropriate option (stop or start). As long as the MySQL server is running, you can run additional applications through a console window, such as the MySQL monitor.

    Part III: Getting Involved with the Code