Chapter 4: Database Administration
189
port=3306
socket=/tmp/mysql.sock
no auto rehash
The above output contains all options for the groups 'client' and 'mysql'.
4.1.3 Installing Many Servers on the Same Machine
In some cases you may want to have many different mysqld daemons (servers) running on
the same machine. You may for example want to run a new version of MySQL for testing
together with an old version that is in production. Another case is when you want to give
different users access to different mysqld servers that they manage themselves.
One way to get a new server running is by starting it with a different socket and port as
follows:
shell> MYSQL_UNIX_PORT=/tmp/mysqld new.sock
shell> MYSQL_TCP_PORT=3307
shell> export MYSQL_UNIX_PORT MYSQL_TCP_PORT
shell> scripts/mysql_install_db
shell> bin/safe_mysqld &
The environment variables appendix includes a list of other environment variables you can
use to affect mysqld. See
Appendix F [Environment variables], page 770
.
The above is the quick and dirty way that one commonly uses for testing. The nice thing
with this is that all connections you do in the above shell will automatically be directed to
the new running server!
If you need to do this more permanently, you should create an option file for each server.
See
Section 4.1.2 [Option files], page 186
. In your startup script that is executed at boot
time you should specify for both servers:
safe_mysqld default file=path to option file
At least the following options should be different per server:
port=#
socket=path
pid file=path
The following options should be different, if they are used:
log=path
log bin=path
log update=path
log isam=path
bdb logdir=path
If you want more performance, you can also specify the following differently:
tmpdir=path
bdb tmpdir=path
189
port=3306
socket=/tmp/mysql.sock
no auto rehash
The above output contains all options for the groups 'client' and 'mysql'.
4.1.3 Installing Many Servers on the Same Machine
In some cases you may want to have many different mysqld daemons (servers) running on
the same machine. You may for example want to run a new version of MySQL for testing
together with an old version that is in production. Another case is when you want to give
different users access to different mysqld servers that they manage themselves.
One way to get a new server running is by starting it with a different socket and port as
follows:
shell> MYSQL_UNIX_PORT=/tmp/mysqld new.sock
shell> MYSQL_TCP_PORT=3307
shell> export MYSQL_UNIX_PORT MYSQL_TCP_PORT
shell> scripts/mysql_install_db
shell> bin/safe_mysqld &
The environment variables appendix includes a list of other environment variables you can
use to affect mysqld. See
Appendix F [Environment variables], page 770
.
The above is the quick and dirty way that one commonly uses for testing. The nice thing
with this is that all connections you do in the above shell will automatically be directed to
the new running server!
If you need to do this more permanently, you should create an option file for each server.
See
Section 4.1.2 [Option files], page 186
. In your startup script that is executed at boot
time you should specify for both servers:
safe_mysqld default file=path to option file
At least the following options should be different per server:
port=#
socket=path
pid file=path
The following options should be different, if they are used:
log=path
log bin=path
log update=path
log isam=path
bdb logdir=path
If you want more performance, you can also specify the following differently:
tmpdir=path
bdb tmpdir=path