SQL Statements for Controlling Slave Servers
1130
• It acquires a global read lock on the master while taking the snapshot, which prevents updates on
the master during the load operation.
If you are loading large tables, you might have to increase the values of
net_read_timeout
[478]
and
net_write_timeout
[479]
on both the master and slave servers. See
Section 5.1.4, “Server
System Variables”
.
Note that
LOAD DATA FROM MASTER
does not copy any tables from the
mysql
database. This makes
it easy to have different users and privileges on the master and the slave.
To use
LOAD DATA FROM MASTER
, the replication account that is used to connect to the master must
have the
RELOAD
[577]
and
SUPER
[578]
privileges on the master and the
SELECT
[578]
privilege for all
master tables you want to load. All master tables for which the user does not have the
SELECT
[578]
privilege are ignored by
LOAD DATA FROM MASTER
. This is because the master hides them from
the user:
LOAD DATA FROM MASTER
calls
SHOW DATABASES
to know the master databases to
load, but
SHOW DATABASES
returns only databases for which the user has some privilege. See
Section 13.7.5.11, “
SHOW DATABASES
Syntax”
. On the slave side, the user that issues
LOAD DATA
FROM MASTER
must have privileges for dropping and creating the databases and tables that are
copied.
13.4.2.3.
LOAD TABLE tbl_name FROM MASTER
Syntax
LOAD TABLE
tbl_name
FROM MASTER
This feature is deprecated and should be avoided. It is subject to removal in a future version of
MySQL.
Since the current implementation of
LOAD DATA FROM MASTER
and
LOAD TABLE FROM MASTER
is
very limited, these statements are deprecated as of MySQL 4.1 and removed in MySQL 5.5.
The recommended alternative solution to using
LOAD DATA FROM MASTER
or
LOAD TABLE FROM
MASTER
is using
mysqldump
or
mysqlhotcopy
. The latter requires Perl and two Perl modules (
DBI
and
DBD:mysql
) and works for
MyISAM
and
ARCHIVE
tables only. With
mysqldump
, you can create
SQL dumps on the master and pipe (or copy) these to a
mysql
client on the slave. This has the
advantage of working for all storage engines, but can be quite slow, since it works using
SELECT
.
Transfers a copy of the table from the master to the slave. This statement is implemented mainly
debugging
LOAD DATA FROM MASTER
operations. To use
LOAD TABLE
, the account used for
connecting to the master server must have the
RELOAD
[577]
and
SUPER
[578]
privileges on the master
and the
SELECT
[578]
privilege for the master table to load. On the slave side, the user that issues
LOAD TABLE FROM MASTER
must have privileges for dropping and creating the table.
The conditions for
LOAD DATA FROM MASTER
apply here as well. For example,
LOAD TABLE FROM
MASTER
works only for
MyISAM
tables. The timeout notes for
LOAD DATA FROM MASTER
apply as
well.
13.4.2.4.
MASTER_POS_WAIT()
Syntax
SELECT MASTER_POS_WAIT('
master_log_file
',
master_log_pos
[,
timeout
])
This is actually a function, not a statement. It is used to ensure that the slave has read and executed
events up to a given position in the master's binary log. See
Section 12.14, “Miscellaneous Functions”
,
for a full description.
The following table shows the maximum permissible length for the string-valued options.
Option
Maximum Length
MASTER_HOST
60
MASTER_USER
16
MASTER_PASSWORD
32
Содержание 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 ...