MySQL on Windows

MySQL Installation

This document describes a recent 5.6 version. The package you'll need is the MySQL installation file (from the course website).
This software (in other versions) is available from the MySQL site (although it's sometimes not obvious how to get it):
MySQL home:
Start by double-clicking the ".msi" file. Make these choices: Here are the configuration steps. The only ones which do not take the default behavior are steps 7 and 8.
  1. Select Configuration Type: take the default, Detailed Configuration. It's a good idea just to see the choices that you're making even if you take the defaults.
  2. Server Type: probably the default, Developer Machine.
  3. Database Usage: probably the default, Multifunctional Database.
  4. InnoDB Tablespace Settings: Take the defaults.
  5. Concurrent Connections Settings: Take the default, Decision Support (DSS/OLAP)
  6. Networking Options: Keep the defaults, Enable TCP/IP Networking and Enable Strict Mode.
  7. Default Character Set: probably the default, Standard Character Set.
  8. Windows options: You want both, so check the second checkbox.
    Install As Windows Service
    Include Bin Directory in Windows PATH
  9. Security Options: Uncheck this checkbox to maintain the initial empty root password.
    Modify Security Settings
  10. Ready To Execute: Go for it! Press the Execute button.

    If the "Start Service" fails, go back to the Windows Options panel and select a different name for the Windows service. If the Apply security settings fails, it may be that you already have a password.
The installation of binaries, configuration files, etc., is the folder:
\Program Files\Mysql\MySQL Server 5.6
The actual databases reside in a subfolder named data, typically in an "Application Data" folder:
\Documents and Settings\All Users\Application Data\MySQL Server 5.6\data
The Windows Programs menu contains the item:
MySQL command-line client: (accessses the command-line mysql as administrative)
After the installation MySQL will probably start up automatically as a background service. Perhaps the easiest way to get to Services is to key this word into the Search Box of the Run menu. Look for MySQL in the list of services, the startup type should be "automatic" and it should be "started" after installation.

Command line management of MySQL

The binaries in the bin subfolder of the installation folder. Hopefully MySQL has already installed this folder in your PATH environment variable. If not, add it through the system Environment Variables. Use the Search Box or
Control Panel → System → Advanced → Environment Variables

Using Cygwin for shell access

If, like me, you prefer the Cygwin shell, you can still get access to your Windows MySQL database via a mysql client. Although the Windows mysql client is is accessible though the Windows PATH, it is not the one to use.

Instead, install the mysql client package in Cygwin, but don't install the mysql server package. Then you will be able to access the Windows MySQL database with an added option like this:
$ mysql --protocol TCP ...
To simplify this usage, create an alias by adding this line to your ~/.bashrc file:
alias mysql='mysql --protocol TCP'
Open a new Cygwin shell and my can now use the mysql client as you would on a Windows command shell, e.g.:
$ mysql -u root

© Robert M. Kline