Multi-Install Configuration Options


It is often useful to be able to run multiple MySQL servers on the same machine. For example, different ISP users may have their own installation. We use this feature to allow students learning about MySQL to each set up and configure their own server.

For each server you start, you must set different values for each of the following options to mysqld:

  • port : Each server must listen on a different port.

  • socket : Under Unix, each server must use a different socket file. Under Windows, the socket option sets the name of the named pipe used by the server. In both cases, this value for socket must be different for each server.

  • shared-memory -base-name (Windows only) : Each server must use a different piece of shared memory.

  • pid-file (Unix only) : Each server needs a different file in which to write its process id (pid).

  • Logging options: If you set any of the log file options, such as log-bin , you will need to set up different log file locations for each server.

An easy way to get some of these is to set the basedir option differently for each server. This will force the data directories and log files to be different. We strongly recommend that each server has its own separate data directory to avoid all sorts of unpleasantness.

The --defaults-file option is really useful for starting each server instance with a different set of defaults (or for installing each server as a Windows service with a separate set of defaults).

One point to note is that if you are running multiple servers, you will need to specify to client programs and other programs that connect to a server, such as mysqladmin, which server you want to connect to. You can use the --port command switch to these programs to do this. In this situation, it can be very useful to set up my.conf files on a per- user basis with the client port set appropriately so that users automatically connect to their own servers.



MySQL Tutorial
MySQL Tutorial
ISBN: 0672325845
EAN: 2147483647
Year: 2003
Pages: 261

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net