Running Multiple MySQL Instances on One Machine
551
For methods of configuring each instance with its own data directory, and warnings about the dangers
of failing to do so, see
Section 5.3.1, “Setting Up Multiple Data Directories”
.
In addition to using different data directories, several other options must have different values for each
server instance:
•
--port=port_num
[417]
--port
[417]
controls the port number for TCP/IP connections. Alternatively, if the host has
multiple network addresses, you can use
--bind-address
[401]
to cause each server to listen to
a different address.
•
--socket=path
[422]
--socket
[422]
controls the Unix socket file path on Unix or the named pipe name on Windows.
On Windows, it is necessary to specify distinct pipe names only for those servers configured to
permit named-pipe connections.
•
--shared-memory-base-name=name
[420]
This option is used only on Windows. It designates the shared-memory name used by a Windows
server to permit clients to connect using shared memory. It is necessary to specify distinct shared-
memory names only for those servers configured to permit shared-memory connections.
•
--pid-file=file_name
[417]
This option indicates the path name of the file in which the server writes its process ID.
If you use the following log file options, their values must differ for each server:
•
--log[=file_name]
[411]
•
--log-bin[=file_name]
[1467]
•
--log-error[=file_name]
[411]
•
--bdb-logdir=file_name
[1309]
For further discussion of log file options, see
Section 5.2, “MySQL Server Logs”
.
To achieve better performance, you can specify the following options differently for each server, to
spread the load between several physical disks:
•
--tmpdir=path
[424]
•
--bdb-tmpdir=path
[1310]
Having different temporary directories also makes it easier to determine which MySQL server created
any given temporary file.
If you have multiple MySQL installations in different locations, you can specify the base directory for
each installation with the
--basedir=path
[401]
option. This causes each instance to automatically
use a different data directory, log files, and PID file because the default for each of those parameters
is relative to the base directory. In that case, the only other options you need to specify are the
--
socket
[422]
and
--port
[417]
options. Suppose that you install different versions of MySQL
using
tar
file binary distributions. These install in different locations, so you can start the server for
each installation using the command
bin/mysqld_safe
under its corresponding base directory.
mysqld_safe
determines the proper
--basedir
[401]
option to pass to
mysqld
, and you need
specify only the
--socket
[248]
and
--port
[248]
options to
mysqld_safe
.
As discussed in the following sections, it is possible to start additional servers by specifying appropriate
command options or by setting environment variables. However, if you need to run multiple servers
Содержание 5.0
Страница 1: ...MySQL 5 0 Reference Manual ...
Страница 18: ...xviii ...
Страница 60: ...40 ...
Страница 396: ...376 ...
Страница 578: ...558 ...
Страница 636: ...616 ...
Страница 844: ...824 ...
Страница 1234: ...1214 ...
Страница 1426: ...MySQL Proxy Scripting 1406 The following diagram shows an overview of the classes exposed by MySQL Proxy ...
Страница 1427: ...MySQL Proxy Scripting 1407 ...
Страница 1734: ...1714 ...
Страница 1752: ...1732 ...
Страница 1783: ...Configuring Connector ODBC 1763 ...
Страница 1793: ...Connector ODBC Examples 1773 ...
Страница 1839: ...Connector Net Installation 1819 2 You must choose the type of installation to perform ...
Страница 1842: ...Connector Net Installation 1822 5 Once the installation has been completed click Finish to exit the installer ...
Страница 1864: ...Connector Net Visual Studio Integration 1844 Figure 20 24 Debug Stepping Figure 20 25 Function Stepping 1 of 2 ...
Страница 2850: ...2830 ...
Страница 2854: ...2834 ...
Страница 2928: ...2908 ...
Страница 3000: ...2980 ...
Страница 3122: ...3102 ...
Страница 3126: ...3106 ...
Страница 3174: ...3154 ...
Страница 3232: ...3212 ...