Multiple MySQL Instances

I have seen a lot of versions of this in the web but I decided to create my own copy for ease of setup and simplicity.

First, download the file “mysql55rev.rar” as seen in this post then extract it somewhere in your harddrive.

Follow these steps:

note: extract-dir is the location which you extracted the archive
edit [extract-dir]\my.ini to match your prefernces

51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
[client]

port=3307

[mysql]

default-character-set=utf8

# SERVER SECTION
# ----------------------------------------------------------------------
#
# The following options will be read by the MySQL Server. Make sure that
# you have installed the server correctly (see above) so it reads this
# file.
#
[mysqld]

# The TCP/IP Port the MySQL Server will listen on
port=3307
73
74
75
76
77
#Path to installation directory. All paths are usually resolved relative to this.
basedir="[extract-dir]"

#Path to the database root
datadir="[extract-dir]/data"

commands via the windows command line (cmd)

1
2
[extract-dir]\bin\mysqld.exe --install "mysql3307" --defaults-file="[extract-dir]\my.ini"
net start mysql3307

use this code if you wish to disable and uninstall the mysql instance

1
2
net stop mysql3307
[extract-dir]\bin\mysqld.exe --remove "mysql3307"

Credentials needed to access the database are included in the archive.
(download: mysql55rev2)


If you wish to create just a separate instance and you already have the binaries, you don’t have to copy the binaries again, instead, just create a new my.ini and specify a different port and data directory. On a side-note, if you encounter an error like “Could not locate mysql.user” when trying to start the server, you need to copy the mysql folder and the performance_schema folder located in the [extract-dir]\data folder from your existing mysql instance to the new instance data folder.


After you have installed the mysql instance as a service via mysqld.exe –install, you can now see the installed service in windows, you can start/stop them manually from here as well.

open the services window:

manually configure the installed mysql instances:


If you have downloaded the mariadb, you can install a new instance keeping the existing binaries following the instructions at the beginning of this configuration file. You may also use this configuration file as basis of your default my.cnf.

Let the others know about this Rant
  • Print
  • Facebook
  • Twitter
  • LinkedIn
  • Plurk

About Christian Noel

Hi, I'm Cris! I'm interested in anime, programming and photography. My profession is programming and am mostly focused in web development. I've been programming since College. What inspired me to go to programming was because I was so into the gaming industry and I wanted to create my own game.
This entry was posted in Techy Thoughts and tagged , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *