HOW TO: Install MySQL on Windows (TEST environment)



The following procedure is designed to help you get a TEST MySQL instance up and running within 10-15 minutes (assuming you have fast broadband access to the internet). It is not designed for a PRODUCTION environment.

If you wish to review detailed installation instructions for a customized MySQL implementation on the Windows environment, you can do that at http://dev.mysql.com/doc/refman/5.0/en/windows-installation.html.

We also recommend performing the installation through a Command Prompt window, even though it might seem slow. A number of PATH-related errors can be avoided through the use of the Command Tool.

If the images on this page are not clear, right-click on the image and choose View Image to see a larger rendition.



1

Download the supported version of MySQL 5.0.x database from their website. Make sure you download the Windows Essentials (x86) package. Save this download in a temporary directory, such as c:\tmp

2

Create the my.cnf file either in the c:\ directory. You may copy the following values or adjust according to your site requirements. In a TEST environment, we recommend using these values to get rapid support from the StrongKey website/FAQ):

If you are using an editor, please use WordPad instead of Notepad. When saving the file in WorldPad, make sure that the file name (my.cnf) is specified within double-quotes (“) and not just by itself. So the filename would look like “my.cnf” in the field. Additionally, the file-type should be a Text document and not Rich Text Format.

Make sure that you change the user parameter and the <hostname> in the file to reflect that of your machine.

[mysqld]
datadir=/usr/local/mysql5/data

#####################################
# Change the value for the following
# variable to the name of the user
# who is installing MySQL
#####################################

user=symkey
lower_case_table_names=1

[mysql.server]
basedir=c:/usr/local/mysql5

#####################################
# Change the hostname from apollo to
# your machine's hostname

#####################################
log=c:/usr/local/mysql5/log/apollo.log
log-error=c:/usr/local/mysql5/log/apollo.err
innodb_data_home_dir = c:/usr/local/mysql5/ibdata
innodb_log_group_home_dir = c:/usr/local/mysql5/iblogs
innodb_data_file_path = ibdata1:10M:autoextend
innodb_flush_log_at_trx_commit = 1
set-variable = innodb_buffer_pool_size=5M
set-variable = innodb_additional_mem_pool_size=5M
set-variable = innodb_log_file_size=5M
set-variable = innodb_log_buffer_size=5M
lower_case_table_names=1

[mysqld_safe]
err-log=c:/usr/local/mysql5/log/mysqld_safe.log
pid-file=c:/usr/local/mysql5/log/mysqld_safe.pid

3

Open a Command Prompt window.

4

Go the the c:\tmp directory (where you saved the downloads) and run the following command:

mysql-essential-5.0.22-win32.msi

You should see the following wizard startup.





5

Click Next to continue. You should see the following:





6

Select Custom and click Next. You should see the following:





7

Click on the Change button to change the location of the installation. Use the c:\usr\local\mysql5 directory for your destination; make sure your wizard looks like the following before clicking OK.

Note: The mysql5 directory does not exist at this stage, so you will not be able to select it from the GUI. You will have to type it in into the Folder Name field at the bottom of the wizard, as shown below.





8

Click Next to continue. You should see:





9

Click Install to continue. You should briefly see the following:





10

This is followed by a Sign Up panel as the following:





11

Choose whichever option you wish and click Next. Eventually, you will come to the following panel:





12

Click Finish. You should see the following:





13

Click Next to continue. You should see:





14

Select Standard Configuration and click Next. You should see:





15

Leave most options on the default values, but check the Include Bin Directory in Windows PATH check-box ON and click Next. You should see:





16

Type in a password for the root use; leave the Enable root access from remote machines check-box OFF. Click Next to continue. You should see:





17

Click Execute to begin the configuration. After a successful completion, you should see:





18

Open a new Command Prompt window (so that the MySQL executables are in the PATH environment variable)

19

Log into mysql using the mysql command (make sure that the c:\usr\local\mysql5\bin directory is in your PATH, or specify the full pathname of the mysql executable):

mysql -u root -p mysql

or

\usr\local\mysql5\bin\mysql -u root -p mysql



You should see a message as follows (where mysql> is the MySQL command prompt):

Welcome to the MySQL monitor. Commands end with ; or \g.

Your MySQL connection id is 19 to server version: 5.0.15-max



Type 'help;' or '\h' for help. Type '\c' to clear the buffer.



mysql>

20

Create the symkey database using (mysql> is the prompt – do not type that in):

mysql> create database symkey;

21

Add the symkey user using:

mysql> grant all on symkey.* to symkey@localhost identified by 'symkey';

22

Add the symkey user again, this time using the actual hostname of the machine on which MySQL was installed in place of <hostname>

mysql> grant all on symkey.* to symkey@<hostname> identified by 'symkey';

23

Create the xenc database using:

mysql> create database xenc;

24

Add the xenc user using:

mysql> grant all on xenc.* to xenc@localhost identified by 'xenc';

25

Add the xenc user again, this time using the actual hostname of the machine on which MySQL was installed in place of <hostname>

mysql> grant all on xenc.* to xenc@<hostname> identified by 'xenc';

26

Exit from mysql using

mysql> quit;

27

Log back into mysql using the symkey user-name and password (supply the password when prompted)

mysql -u symkey -p symkey

28

Verify that you are using the symkey database, as the symkey user, by typing the following:

mysql> status;

29

Exit from mysql using quit

30

Log back into mysql using the xenc user-name and password (supply the password when prompted)

mysql -u xenc -p xenc

31

Verify that you are using the xenc database, as the xenc user, by typing the following :

mysql> status;

32

Exit from mysql using

mysql> quit;