Oracle 5.0 Reference Manual page 1278

Table of Contents

Advertisement

innodb_file_per_table
For the proper procedure to do this, see
Database".
If you can shut down the master or an existing slave, you can take a cold backup of the
tablespace and log files and use that to set up a slave. To make a new slave without taking down any
server you can also use the commercial
You cannot set up replication for
works only for
MyISAM
• Dump the table on the master and import the dump file into the slave.
• Use
ALTER TABLE tbl_name ENGINE=MyISAM
LOAD TABLE tbl_name FROM
table back to
InnoDB
definitions because the definitions will be lost.
Transactions that fail on the master do not affect replication at all. MySQL replication is based on the
binary log where MySQL writes SQL statements that modify data. A transaction that fails (for example,
because of a foreign key violation, or because it is rolled back) is not written to the binary log, so it is
not sent to slaves. See
Replication and CASCADE.
the slave only if the tables sharing the foreign key relation use
Suppose that you have started replication, and then create two tables on the master using the following
statements:
CREATE TABLE
CREATE TABLE fc1 (
i INT PRIMARY KEY,
j INT
) ENGINE = InnoDB;
CREATE TABLE fc2 (
m INT PRIMARY KEY,
n INT,
FOREIGN KEY ni (n) REFERENCES fc1 (i)
ON DELETE CASCADE
) ENGINE = InnoDB;
Suppose that the slave does not have
on the slave are created, but they use the
ignored. Now we insert some rows into the tables on the master:
master>
INSERT INTO fc1 VALUES (1, 1), (2, 2);
Query OK, 2 rows affected (0.09 sec)
Records: 2
Duplicates: 0
master>
INSERT INTO fc2 VALUES (1, 1), (2, 2), (3, 1);
Query OK, 3 rows affected (0.19 sec)
Records: 3
Duplicates: 0
At this point, on both the master and the slave, table
rows, as shown here:
master>
SELECT * FROM fc1;
+---+------+
| i | j
|
+---+------+
| 1 |
1 |
| 2 |
2 |
+---+------+
2 rows in set (0.00 sec)
master>
SELECT * FROM fc2;
Creating and Using
[1241]
variable is enabled, you must also copy the
Section 14.2.5, "Backing Up and Recovering an
MySQL Enterprise Backup
using the
InnoDB
tables. There are two possible workarounds:
MASTER, and then use
afterward. However, this should not be done for tables that have foreign key
Section 13.3.1,
"START
Cascading actions for
InnoDB
MyISAM
Warnings: 0
Warnings: 0
1258
Tables
InnoDB
tool.
LOAD TABLE FROM MASTER
on the master before setting up replication with
ALTER TABLE
TRANSACTION, COMMIT, and
tables on the master are replicated on
InnoDB
InnoDB
support enabled. If this is the case, then the tables
storage engine, and the
contains 2 rows, and table
fc1
files as well.
.ibd
InnoDB
InnoDB
statement, which
to convert the master
Syntax".
ROLLBACK
on both the master and slave.
option is
FOREIGN KEY
contains 3
fc2

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mysql 5.0

Table of Contents