Installing on Windows


To install MySQL on recent versions of Windows, you will need to be logged in as an administrator.

If you already have a version of MySQL installed, you will need to stop the server before installing a new version. You can do this with the following:

 
 mysqladmin -u root -p shutdown 

If you have MySQL installed as a service, you will need to remove the service. You can do this from the command prompt by typing this:

 
 mysqld --remove 

You may need to replace mysqld with the name of the server binary you originally installed as a service.

If you prefer a graphical tool, you can also remove the service from the Services Manager, located under Administrative Tools Services on Control Panel, or on some systems under Microsoft Management Console.

Please understand that installing MySQL can be quite complex, and your experiences may differ due to previously installed versions of MySQL or your version of Windows.

Begin installing MySQL by unzipping your download file.

Depending on when you read this, the contents of this file will vary. At the time of writing, MySQL was installed by running setup.exe. However, MySQL AB, the company that makes MySQL, is planning an MSI installer. If you see a .msi file instead of setup.exe, you can install MySQL by double-clicking on the MSI file.

The setup program will give you the option to install MySQL in the default location (c:\mysql) or elsewhere. This book assumes that you'll install it in the default location.

After MySQL is installed, you will need to create an options file to set up your initial MySQL configuration. You should do this before starting the server for the first time. Details of the configuration can be found in the section "Configuring Your System," later in this chapter.

After performing your configuration, it is usually a good idea to start your server for the first time from the command line. (In a moment, we will look at how to install it as a service, but let's check whether it's working first.)

Open a command-prompt window and go to the directory where the MySQL server is located. If you have the standard installation, this will be c:\mysql\bin.

Type the following:

 
 mysqld-max --standalone 

This should give you a set of startup messages. Assuming that everything goes well, you can then install MySQL as a service.

Type the name of the server executable you plan to use followed by --install . For example:

 
 mysqld-max --install 

The mysqld-max executable is the one we recommend for use with this book.

There is one final thing you should do to make your MySQL installation fully functional. Some of the associated programs that come with MySQL are actually scripts written in the Perl language, so you will need a Perl engine to run them. Download and install ActivePerl from ActiveState at the following URL:

www.activestate.com/Products/ActivePerl/

ActivePerl comes as an MSI file. Download this file and install ActivePerl by double-clicking on it. You can stick with all the default options that the installer gives you for use with MySQL.



MySQL Tutorial
MySQL Tutorial
ISBN: 0672325845
EAN: 2147483647
Year: 2003
Pages: 261

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net