MySQL Reference Manual for version 4.0.18.

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

5.9.1.1 Starting Multiple Windows Servers at the Command Line

To start multiple servers manually from the command line, you can specify the appropriate options on the command line or in an option file. It's more convenient to place the options in an option file, but it's necessary to make sure that each server gets its own set of options. To do this, create an option file for each server and tell the server the filename with a --defaults-file option when you run it.

Suppose you want to run mysqld on port 3307 with a data directory of `C:\mydata1', and mysqld-max on port 3308 with a data directory of `C:\mydata2'. To accomplish this, create two option files. For example, create one file named `C:\my-opts1.cnf' that looks like this:

 
[mysqld]
datadir = C:/mydata1
port = 3307

Create a second file named `C:\my-opts2.cnf' that looks like this:

 
[mysqld]
datadir = C:/mydata2
port = 3308

Then start each server with its own option file:

 
shell> mysqld --defaults-file=C:\my-opts1.cnf
shell> mysqld-max --defaults-file=C:\my-opts2.cnf

(On NT, the servers will start in the foreground, so you'll need to issue those two commands in separate console windows.)

To shut down the servers, you must connect to the appropriate port number:

 
shell> mysqladmin --port=3307 shutdown
shell> mysqladmin --port=3308 shutdown

Servers configured as just described will allow clients to connect over TCP/IP. If you also want to allow named pipe connections, use the mysqld-nt or mysqld-max-nt servers and specify options that enable the named pipe and specify its name. (Each server that supports named pipe connections must use a unique pipe name.) For example, the `C:\my-opts1.cnf' file might be written like this:

 
[mysqld]
datadir = C:/mydata1
port = 3307
enable-named-pipe
socket = mypipe1

Then start the server this way:

 
shell> mysqld-nt --defaults-file=C:\my-opts1.cnf

`C:\my-opts2.cnf' would be modified similarly for use by the second server.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

This document was generated by rdg (Feb 25 2004) using texi2html