Setting Up Multiple Data Directories - Oracle 5.0 Reference Manual

Table of Contents

Advertisement

on a more permanent basis, it is more convenient to use option files to specify for each server those
option values that must be unique to it. The

5.3.1. Setting Up Multiple Data Directories

Each MySQL Instance on a machine should have its own data directory. The location is specified using
the
--datadir=path
There are different methods of setting up a data directory for a new instance:
• Create a new data directory.
• Copy an existing data directory.
The following discussion provides more detail about each method.
Create a New Data Directory
With this method, the data directory will be in the same state as when you first install MySQL. It will
have the default set of MySQL accounts and no user data.
On Unix, initialize the data directory by running mysql_install_db. See
Postinstallation
On Windows, the data directory is included in MySQL distributions. If you obtain a distribution in
Windows Zip archive format, you can unpack it into a temporary location, then copy the
from this location to where you are setting up the new instance.
Copy an Existing Data Directory
With this method, any MySQL accounts or user data present in the data directory are carried over to
the new data directory.
1. Stop the existing MySQL instance using the data directory. This must be a clean shutdown so that
the instance flushes any pending changes to disk.
2. Copy the data directory to the location where the new data directory should be.
3. Copy the
the new instance.

Setting Up Multiple Data Directories

[404]
option.
Warning
Normally, you should never have two servers that update data in the same
databases. This may lead to unpleasant surprises if your operating system does
not support fault-free system locking. If (despite this warning) you run multiple
servers using the same data directory and they have logging enabled, you must
use the appropriate options to specify log file names that are unique to each
server. Otherwise, the servers try to log to the same files.
Even when the preceding precautions are observed, this kind of setup works
only with
MyISAM
engines. Also, this warning against sharing a data directory among servers
always applies in an NFS environment. Permitting multiple MySQL servers
to access a common data directory over NFS is a very bad idea. The primary
problem is that NFS is the speed bottleneck. It is not meant for such use.
Another risk with NFS is that you must devise a way to ensure that two or more
servers do not interfere with each other. Usually NFS file locking is handled
by the
daemon, but at the moment there is no platform that performs
lockd
locking 100% reliably in every situation.
Procedures".
or
option file used by the existing instance. This serves as a basis for
my.cnf
my.ini
--defaults-file
and
tables, and not with any of the other storage
MERGE
552
[240]
option is useful for this purpose.
Section 2.18.1, "Unix
directory
data

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the 5.0 and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Mysql 5.0

Table of Contents