home | O'Reilly's CD bookshelfs | FreeBSD | Linux | Cisco | Cisco Exam  


Book HomeManaging and Using MySQLSearch this book

2.3. Windows Installation

The distributions for Windows can be found in the same place as the distributions for Unix: at http://www.mysql.com/downloads or at one of the mirror sites. Windows installation is simply a matter of downloading the mysql-version.zip, unzipping it, and running the set-up program.

The default install location for MySQL Windows is c:\mysql. The installer will allow you to change the location. However, if you choose to do so, you may need to modify some configuration files to get everything working correctly. Refer to the full MySQL installation documentation at http://www.mysql.com/documentation for more information.

The installer will give you the choice between a typical, compact, or custom install. You should use the typical install unless you wish to modify the list of components that are installed. In that case, use the custom install.

The Windows binary distribution contains several servers from which to choose. Table 2-2 lists these servers.

Table 2-2. Servers that come with the Windows distribution

Server name

Description

mysqld

Debug binary with memory allocation checking, symbolic link support, and transactional table support (InnoDB and DBD)

mysqld-opt

Optimized binary with no support for transactional tables

mysqld-nt

Optimized binary with support for NT named pipes

mysqld-max

Optimized binary with support for transactional tables

mysqld-max-nt

Optmized binary with support for NT named pipes and transactional tables

Once you have the software installed, the next step is to start the server. Though the binaries are the same, the procedure for running the server is different depending on whether you are using Windows 95/98 or Windows NT/2000. Each is covered separately.

2.3.1. Windows 9x Startup

To run MySQL on a Windows 9x system, you need TCP/IP support installed. This can be found on your Windows CD-ROM, if you have not installed it already. If your computer can connect to the Internet in any way, it already has TCP/IP support installed.

TIP: If you are running Windows 95, make sure you have the right version of Winsock. MySQL requires Winsock 2. Obtain the latest version of Winsock from http://www.microsoft.com. This is not an issue for users of Windows 98 or Windows Me.

You will need to choose which server you would like to run from those described in Table 2-2. Note that you can run the '-nt' binaries, but you don't benefit from it, because named pipes are not supported on the Windows 9x platform. Assume for our example we have decided to run mysql-opt. To get the server started, open an MS-DOS window and type:

C:\> c:\mysql\bin\mysqld-opt

To stop the server, in an MS-DOS window type:

C:\> c:\mysql\bin\mysqladmin -u root shutdown

To get MySQL to start automatically with the operating system, stick a shortcut to the winmysqladmin.exe application in the StartUp folder. This will also have MySQL shut down automatically when you restart or shut down Windows.

2.3.2. Windows NT/2000 Startup

On Windows NT, you should have at least service pack 3 to get the right level of TCP/IP support for MySQL.

We recommend that you run the MySQL server as an NT service. The simplest way to install MySQL as a service is to use the winmysqladmin.exe utility that comes with a Windows installation of MySQL. You can use this tool to configure MySQL and install it as a service.

To install MySQL as a service by hand, open up an MS-DOS window and type:

C:\> c:\mysql\bin\mysqld-nt -install

This will create an NT service called MySQL. This service is now available from the Services control panel. To access this, open your control panel and double-click on the Services icon.[4] Figure 2-1 shows the Services control panel from a Windows NT box with MySQL installed as a service.

[4]On Windows 2000, click on the Administrative Tools icon in the control panel to open the Services control panel.

Figure 2-1

Figure 2-1. A Windows NT Services control panel with MySQL installed

Now you can start MySQL by clicking on the Start button. If you would like to change the command-line options for the MySql service, you can type them in the Startup Parameters text box before starting the service. In Figure 2-2, after the service has started, the status shows as Started.

Figure 2-2

Figure 2-2. The Started MySQL service

To stop the service, click on Stop. You can also start and stop the service from an MS-DOS prompt using the net start and net stop commands. To start it this way, open an MS-DOS window and type:

C:\> net start mysql
The MySql service is starting.
The MySql service was started successfully.

To stop it again, type:

C:\> net stop mysql
The MySql service is stopping............
The MySql service was stopped successfully.


Library Navigation Links

Copyright © 2003 O'Reilly & Associates. All rights reserved.