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:
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. |