Replication and Binary Logging Options and Variables
1459
Tells the slave to translate the default database (that is, the one selected by
USE
) to
to_name
if it
was
from_name
on the master. Only statements involving tables are affected (not statements such
as
CREATE DATABASE
,
DROP DATABASE
, and
ALTER DATABASE
), and only if
from_name
is the
default database on the master. This does not work for cross-database updates. To specify multiple
rewrites, use this option multiple times. The server uses the first one with a
from_name
value that
matches. The database name translation is done before the
--replicate-*
rules are tested.
If you use this option on the command line and the “
>
” character is special to your command
interpreter, quote the option value. For example:
shell>
mysqld --replicate-rewrite-db="olddb->newdb"
•
--replicate-same-server-id
[1459]
Version Introduced
5.0.1
Command-Line Format
--replicate-same-server-id
Option-File Format
replicate-same-server-id
Permitted Values
Type
boolean
Default
FALSE
To be used on slave servers. Usually you should use the default setting of 0, to prevent infinite
loops caused by circular replication. If set to 1, the slave does not skip events having its own
server ID. Normally, this is useful only in rare configurations. Cannot be set to 1 if
--log-slave-
updates
[1451]
is used. By default, the slave I/O thread does not write binary log events to the
relay log if they have the slave's server ID (this optimization helps save disk usage). If you want to
use
--replicate-same-server-id
[1459]
, be sure to start the slave with this option before you
make the slave read its own events that you want the slave SQL thread to execute.
•
--replicate-wild-do-table=db_name.tbl_name
[1459]
Command-Line Format
--replicate-wild-do-table=name
Option-File Format
replicate-wild-do-table
Permitted Values
Type
string
Tells the slave thread to restrict replication to statements where any of the updated tables match
the specified database and table name patterns. Patterns can contain the “
%
” and “
_
” wildcard
characters, which have the same meaning as for the
LIKE
[896]
pattern-matching operator. To
specify more than one table, use this option multiple times, once for each table. This works for cross-
database updates. See
Section 16.2.3, “How Servers Evaluate Replication Filtering Rules”
.
This option applies to tables, views, and triggers. It does not apply to stored procedures and
functions. To filter statements operating on the latter objects, use one or more of the
--replicate-
*-db
options.
Example:
--replicate-wild-do-table=foo%.bar%
[1459]
replicates only updates that use a
table where the database name starts with
foo
and the table name starts with
bar
.
If the table name pattern is
%
, it matches any table name and the option also applies to database-
level statements (
CREATE DATABASE
,
DROP DATABASE
, and
ALTER DATABASE
). For example,
if you use
--replicate-wild-do-table=foo%.%
[1459]
, database-level statements are
replicated if the database name matches the pattern
foo%
.
To include literal wildcard characters in the database or table name patterns, escape them with a
backslash. For example, to replicate all tables of a database that is named
my_own%db
, but not
Содержание 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 ...