Softpedia
 

NEWS CATEGORIES:



NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
Home > News > Webmaster > Tips and Tricks

August 29th, 2007, 13:53 GMT · By Adrian Placinta

Install Multiple MySQL Services

SHARE:

Adjust text size:



Enlarge picture
If you want to test the new version of MySQL without compromising your existing MySQL settings, you can run multiple instances of MySQL as services.

You can install MySQL services using the --install or --install-manual option:

- If you don't specify any service name, the server will use the default service name of MySQL and the options from the [mysqld] group in the standard option files.
- Specify the service name after the --install option and the server reads options from the group that has the same name as the service. The server reads options
from the standard option files.
- If you want to read options only from the [mysqld] group of the named file, specify a --defaults-file option after the service name and the server will ignore the standard option files;

To begin, setup my.cnf file to look like this:

# options for mysqld1 service
[mysqld1]
basedir = C:/mysql-5.0.45
port = 3307
enable-named-pipe
socket = mypipe1

# options for mysqld2 service
[mysqld2]
basedir = C:/mysql-5.1.21-beta
port = 3308
enable-named-pipe
socket = mypipe2


The next move is to install manually the services using the following commands:

C:> C:mysql-5.0.19 inmysqld-nt --install mysqld1
C:> C:mysql-5.1.21-beta inmysqld-nt --install mysqld2


Then start the services manually:

C:> NET START mysqld1
C:> NET START mysqld2


Another way is to create different configuration files: C:my-opts1.cnf and C:my-opts2.cnf . For mysql 5.0.45 the config will look like that:

[mysqld]
basedir = C:/mysql-5.0.45
port = 3307
enable-named-pipe
socket = mypipe1


and for mysql-5.1.21-beta the configuration file will look like this:

[mysqld]
basedir = C:/mysql-5.1.21-beta
port = 3308
enable-named-pipe
socket = mypipe2


Create the services using the following commands:

C:> C:mysql-5.0.19 inmysqld-nt --install mysqld1 --defaults-file=C:my-opts1.cnf
C:> C:mysql-5.1.21-beta inmysqld-nt --install mysqld2 --defaults-file=C:my-opts2.cnf


After that, start the services manually as explained above.

If you want to remove the services, use the mysql --remove option.

TELL US WHAT YOU THINK:

13,043 hits · Link to this article · Print article · Send to friend · Subscribe to news

MUST-READ RELATED ARTICLES:


Create MySQL database backup

How to Copy an MYSQL Database from One Computer to Another

Install and configure MySQL for Windows

How to Limit Account Resources in MySQL

READER COMMENTS:



No user comments yet.
Be the first to express your opinion!
Copyright © 2001-2012 Softpedia. Contact/Tip us at

WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM