1. INSTALLATION
-------------------------------------------------------------------
If you not have done this before you have to download and install 
MySQL Community Server (www.mysql.com) on the computer that should 
act as a database server, we downloaded and installed the 5.1.51 
version. Download and install MySQL Connector Net on your webserver 
and your developing computer to be able to connect to a MySQL database 
from code. You should also download and install MySQL Workbench 
(GUI Tool) that are replacing MySQL Query Browser and MySQL 
Administrator (older MySQL tools), we downloaded and installed the 
5.2.28 version of MySQL Workbench.
-------------------------------------------------------------------

2. SET UP THREE MySQL SERVER INSTANCES
-------------------------------------------------------------------
First we need to have three different data directories and we 
therefore browse to "C:\ProgramData\MySQL\MySQL Server 5.1". We
add a folder called "masterdata", add a second folder called
"slaveonedata" and add a third folder called "slavetwodata".
There is now four folders in "C:\ProgramData\MySQL\MySQL Server 5.1",
data, masterdata, slaveonedata and slavetwodata. Copy the "mysql"
folder in the data folder to all of the newly created folders so
that we have a system database in each database folder.

We also need to have 3 different folders for InnoDB and we therefore
browse to "C:\MySQL Datafiles" and add one folder called "master",
one called "slaveone" and one called "slavetwo". If you dont want
to use InnoDB you need to include "skip-innodb" in the 
configuration file for each server instance. It is important that
you add these folders because you will not be able to start the 
Windows service for MySQL if you dont do this (i had to struggle
some hours with this). 

Secondly we need to have three different configuration files so we 
copy the my.ini file in "C:\Program Files\MySQL\MySQL Server 5.1" 
and rename the copy to "master.ini", we make a second copy
of my.ini and set the name to "slave1.ini" and finally we
make a third copy of my.ini and set the name to "slave2.ini". 
If you want remote access to the server instances you have to 
create exceptions for port 3307, 3308 and 3309 in Windows Firewall. 
Edit each configuration file so that each file has different ports 
(3307, 3308 and 3309) and data directories.

To be able to edit the files you must first copy them to the
desktop or one folder where you have permission to save the
edited files.

/////////// Changes in the master.ini file /////////////
[client]
port=3307

# The TCP/IP Port the MySQL Server will listen on
port = 3307

#Path to the database root
datadir = "C:/ProgramData/MySQL/MySQL Server 5.1/masterdata"

#*** INNODB Specific options ***
innodb_data_home_dir="C:/MySQL Datafiles/master"

/////////// Changes in the slave1.ini file /////////////
[client]
port=3308

# The TCP/IP Port the MySQL Server will listen on
port = 3308

#Path to the database root
datadir = "C:/ProgramData/MySQL/MySQL Server 5.1/slaveonedata"

#*** INNODB Specific options ***
innodb_data_home_dir="C:/MySQL Datafiles/slaveone"

/////////// Changes in the slave2.ini file /////////////
[client]
port=3309

# The TCP/IP Port the MySQL Server will listen on
port = 3309

#Path to the database root
datadir = "C:/ProgramData/MySQL/MySQL Server 5.1/slavetwodata"

#*** INNODB Specific options ***
innodb_data_home_dir="C:/MySQL Datafiles/slavetwo"

Finally you have to install three windows services for MySQL so
that you can run three MySQL server instances on the computer. Make
sure that you have stopped the first service "MySQL" before you
install the new ones. Open the "command prompt as a administrator 
to have the neccessary permissions to install a windows service.

C:\Windows\system32>cd..
C:\Windows>cd..
C:\>cd program files
C:\Program Files>cd MySQL
C:\Program Files\MySQL>cd MySQL Server 5.1
C:\Program Files\MySQL\MySQL Server 5.1>cd bin

C:\Program Files\MySQL\MySQL Server 5.1\bin>mysqld --install MySQL1 --defaults-file="C:\Program Files\MySQL\MySQL Server 5.1\master.ini"
Service successfully installed.

C:\Program Files\MySQL\MySQL Server 5.1\bin>mysqld --install MySQL2 --defaults-file="C:\Program Files\MySQL\MySQL Server 5.1\slave1.ini"
Service successfully installed.

C:\Program Files\MySQL\MySQL Server 5.1\bin>mysqld --install MySQL3 --defaults-file="C:\Program Files\MySQL\MySQL Server 5.1\slave2.ini"
Service successfully installed.

If you want to remove (uninstall) a windows service you can type:
C:\Program Files\MySQL\MySQL Server 5.1\bin>mysqld --remove MySQL2
Service successfully removed.

When you have installed these services go to Control Panel>
Administrative Tools>Services and start the three windows services 
(MySQL1, MySQL2 and MySQL3) that you have installed.

3. CREATE THREE MySQL SERVER INSTANCES IN MySQL WORKBENCH
-------------------------------------------------------------------
Open "MySQL Workbench" and click on "New Server Instance" under 
"Server Administration. In the wizard for "Create New Server Instance"
select "localhost" and click next, give the new connection a 
"Connection Name" (masterconnection), set the "Hostname" to 
"localhost", let the "Port" be 3307, let the "Username" be "root"and 
then click on "Next". In the next step there is a test for the database 
connection, we entered the password for the root user, succeded with the 
test and clicked "Next". The check for "MySQL configuration file" returned 
a error that the file doesnt exist but we ignored this and clicked "Next" 
until we reached the page to "Create the Instance Profile". We entered the 
"Server Instance Name" as "mysqlmaster@localhost".

Change name for the connections in "Manage Connections" under SQL Development
because the name is always set to localhost when we create a new MySQL
Server Instance. Repeat the step to create a MySQL Server Instance two times
more but give every instance a different connection (masterconnection, 
slaveoneconnection, slavetwoconnection), a different port (3307,3308,3309) and
a different name (mysqlmaster@localhost, mysqlslaveone@localhost, 
mysqlslavetwo@localhost).

Click on "Manage Server Instances", select the mysqlmaster@localhost instance,
click on the "System Profile" tab, set the "Installation Type" to Custom, set
the "Configuration File" to "C:\Program Files\MySQL\MySQL Server 5.1\master.ini",
set the value for "Configuration File Section" to "mysqld" and set the "Windows
Service Name" to "MySQL1". Do the same thing for the other two MySQL Server Instances 
and select the "slave1.ini" file for slave one and "slave2.ini" file for slave
two. Set the "Windows Service Name" to "MySQL2" for slave one and to "MySQL3"
for slave 2.
-------------------------------------------------------------------