Installing the MySQL Database Server for Local Development
For: All Windows Versions
Revised: January 15, 2004
Important: The Java application server and MySQL database are not included as
part of the kinetic Service annual fee. These technologies are available on an
as-requested basis for an additional fee. Contact David Drum at
david@more.net
or (800) 509-6673 for additional information.
Contents
- Overview
- Requirements
- Downloading the MySQL Installer
- Upgrading/Uninstalling MySQL
- Overview of Administrative Accounts and
Databases
- Installing MySQL
- Starting MySQL
- Stopping MySQL
Overview
This document details how to install and configure MySQL as a database
for web site development. This version of MySQL is provided as a service
to customers of MOREnet for creating a development environment
that closely matches MOREnet production servers.
Important: This document details how to use the installer created
by MOREnet for MySQL. The functionality of MySQL has not been modified in the
distribution described below. However, it contains modifications to table data
and permissions granted to administrators to match those used on kinetic
Service production servers. Individuals using MOREnet's distribution of MySQL
must use it with the other local development environment distributions from
MOREnet to ensure a working environment. Do not mix and match MOREnet's
distributions with distributions from the official software vendors. See
Local Development Overview
for a complete list. Otherwise, please visit the official
MySQL web site to obtain a
distribution.
Requirements
Your computer must meet the following requirements:
- A Windows system with approximately 26 MB of free hard drive
space for the installed application.
- Please see the
MySQL documentation
for information about software requirements. Windows requirements
are detailed in the section titled "Installing MySQL on Windows."
Downloading the MySQL Installer
Download the MySQL installer from the kinetic Resources web site and save it to a temporary directory
of your choice.
Upgrading/Uninstalling MySQL
If you have an existing version of MySQL on your system and you would
like to use the version provided by MOREnet's MySQL installer,
you must first uninstall the existing installation. MOREnet's MySQL installer
will not install the database server if it detects that an existing version
of MySQL is installed according to these conditions:
- The MySQL binaries exist in
C:\mysql\bin, indicating that an
installation exists.
- The
C:\mysql\data directory exists, indicating that
database tables from an existing installation or an uninstalled version
exist.
- A
C:\my.cnf or C:\<Windows-system-directory>\my.ini files
exist, indicating that configuration options exist for a previously installed version.
More information about these files is provided in the uninstall procedure
below.
Complete these steps to uninstall your existing installation so that
you can upgrade:
- If you installed MySQL from a binary version on the MySQL web site, open
Add/Remove Programs in the Control Panel, select
MySQL Servers and Clients x.xx.xx, and then click Change/Remove.
If you installed MySQL from a previous version of the MOREnet MySQL installer,
open Add/Remove Programs in the Control Panel, select
MySQL x.xx.xx, and then click Change/Remove.
Important: If you have moved MySQL from its default installation
directory of C:\mysql, regardless of where you got the installer,
you should move the installation back to this location before you attempt
to uninstall it. In addition, you should save the C:\my.cnf
and/or C:\{Windows-system-directory}\my.ini files that
you created when you moved the application and keep them in a temporary
directory in case you need them at a later time. These
files are documented in the
MySQL documentation.
You manually create these files to change the behavior of MySQL,
so you should save copies of them in another location for future reference
and then delete the existing files.
- You will be prompted during the uninstall if you want to delete
the existing data. If you would like to use your existing data in a
new installation of MySQL, click No when that prompt appears.
Copy the data directory, its subdirectories, and its files to
a temporary location. When the new installation is finished, replace the new
data directory with your old data directory. If you do not
need this data, click Yes to delete it.
- Proceed to the Installing MySQL section.
Overview of Administrative Accounts and Databases
Please take time to review the information below so it is familiar to
you during the installation.
Accounts
You will enter passwords for MySQL accounts during the installation.
Two of these accounts allow you to administer the MySQL server and its
databases. The other two accounts support features in the
Tomcat application server that runs on your desktop. These
accounts include:
- root. This account is the main administrative account for
the version of MySQL that runs on your desktop. Likewise, MOREnet
administrators use this account to manage the databases on a
production server. You may use this account to perform any
administrative duties in your desktop version of MySQL, including
the setting of grants and priveleges for other accounts. You will
not be given an account on a production system that mimics
this account's abilities.
- local. This account is a secondary administrative account
for MySQL. This account is granted priveleges to perform the same
functions in your desktop version of MySQL as the account you are
given to remotely administer your web application database tables on a
production server. Note that on a production server,
this name is unique for each customer and it typically reflects
your organization's name. For example, if your
organization was the 'state lottery', this name might be 'lottery' or
'statelottery'.
- localweb. This account is provided for use by your web
applications. It is granted priveleges to perform the same
functions in your desktop version of MySQL as the account that will be
set up on a production server for use by your web applications. Note
that your web applications do not need to know this account name or
its password since they use a JNDI named
JDBC datasource for access to the database. For more information about
the datasource, see the
MySQL Database
Usage section of the
Web Application
Design Guidelines document.
- localrealm. This account is configured during the Tomcat
installation for authenticating Tomcat Manager user names and roles
from records in a MySQL database. This account will not be configured
until you install Tomcat, but it is included here for completeness.
You will not be given a counterpart to this account on production
systems since Tomcat will already be configured to authenticate
user names and passwords for the Tomcat Manager web application.
Databases
During the Tomcat installation, two databases are created in your
desktop version of MySQL. MOREnet administrators create counterparts
to these databases on the production server to support your services.
These include:
- local. This database is created in your desktop version
of MySQL for use by your web applications. You may create as many
tables as needed in this database to support your web applications.
Note that on a production server, each customer is given a unique
database name that reflects the name of the organization. For example,
if your organization was the 'state lottery', this name might be
'lottery' or 'statelottery'.
- local_realm. This database is created in your desktop
version of MySQL for use by the Tomcat application server for
authenticating Tomcat Manager user names and passwords.
Note that on a production server, each customer is given a unique
database name that reflects the name of the organization. For example,
if your organization was the 'state lottery', this name might be
'lottery_realm' or 'statelottery_realm'.
On a production server, the localrealm database contains
the users and user_roles tables, and you may use the
equivalent of the local account described above to
administer it. You may do the same to administer this database on
your local system.
Installing MySQL
- Double-click on the MySQL installer you downloaded in the previous
section to start the installation.
- Review the license page that displays. If you agree with the license, click
I Agree; otherwise click Cancel to cancel the installation.
- A list of components is displayed. If you are running Windows NT, Windows
2000, or Windows XP, select the NT Service (NT,2k,XP only) component.
Do not be alarmed that the installation type of Custom is automatically
selected when you select the NT Service component. Running MySQL as an
NT service provides optimum performance under these operating systems.
- The installer will attempt to install MySQL to
C:\mysql. If
you prefer that MySQL be installed to a different directory, continue the
installation. You can move it after the installation is complete as described
in the MySQL documentation, but this is not recommended.
Note: The installation will not continue if it detects that an
existing version of MySQL is installed on your system. To upgrade an existing
installation, complete the Upgrading/Uninstalling
MySQL section.
- The MySQL Configuration Options window displays. These options
allow you to set passwords for the various accounts you'll use to administer
and access the database. The accounts are discussed in the
Overview of Administrative Accounts and Databases
section of this document. The options are detailed in the steps below.
- Specify the password for the 'root' account in MySQL within the
'root' Password option. Type a secure password in this
option. Record this password for future use and keep it in a safe place.
- Specify the password for the 'local' account in MySQL within the
'local' Password option. Type a secure password in this
option. Record this password for future use and keep it in a safe place.
- Specify the password for the 'localweb' account in MySQL within the
'localweb' Password option. Type a secure password in this option.
Record this password for future use and keep it in a safe place.
- Click Next when you are done with the configuration options.
- When the installation is complete, click Close.
- You may delete the MySQL installation file that you
saved to a temporary location to save space on your hard drive.
Starting MySQL
Follow the steps below for your system type:
Windows 95, Windows 98, and Windows ME:
Click Start, MySQL, Start MySQL Batch. A DOS prompt appears and
displays a command line. This window will continue to display until you
stop MySQL.
Windows NT, Windows 2000, and Windows XP
Click Start, MySQL, Start MySQL Service. A DOS prompt will very
quickly appear and then disappear as the service starts.
The MySQL service is configured with a Startup Type setting of
manual so that you must manually start the service when you want it
to run. It will not run automatically when your system is started. You can
change this setting, as well as start and stop the service, with tools
available on your system. To see your system's services and change the
Startup Type settings, do the following:
- In Windows 2000, select Start, Settings, Control Panel and
then select Administrative Tools. Within the Administrative
Tools window, select Services. Right-click the service
name and then select Properties. Change the Startup Type
option to Automatic.
- In Windows NT, select Start, Settings, Control Panel and
then select Services. Click the service name in the list
to highlight it and then click the Startup...
button. Change the Startup Type option to Automatic.
Stopping MySQL
Follow the steps below for your system type:
Windows 95, Windows 98, and Windows ME:
Click Start, MySQL, Stop MySQL Batch. A DOS prompt appears and
displays a command line. Below the command line you'll see the prompt
Enter Password. Type the password for the 'root' user and press
Enter. The DOS prompt will disappear and the other window that remained
open when you started MySQL will also disappear.
Windows NT, Windows 2000, and Windows XP
Click Start, MySQL, Stop MySQL Service. A DOS prompt will very
quickly appear and then disappear as the service stops.
|