59 lines
1.4 KiB
Plaintext
59 lines
1.4 KiB
Plaintext
include/master-slave.inc
|
|
Warnings:
|
|
Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
|
|
Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
|
|
[connection master]
|
|
DROP DATABASE IF EXISTS replica;
|
|
CREATE DATABASE replica;
|
|
CREATE TABLE t1 (a INT NOT NULL KEY, b text NOT NULL)ENGINE=NDB;
|
|
CREATE TABLE t2 (a INT NOT NULL KEY, b text NOT NULL)ENGINE=NDB;
|
|
USE replica;
|
|
CREATE TABLE replica.t1 (a INT NOT NULL KEY, b text NOT NULL)ENGINE=NDB;
|
|
CREATE TABLE replica.t2 (a INT NOT NULL KEY, b text NOT NULL)ENGINE=NDB;
|
|
USE test;
|
|
INSERT INTO t1 VALUES(1, repeat('abc',10));
|
|
INSERT INTO t2 VALUES(1, repeat('abc',10));
|
|
SHOW TABLES;
|
|
Tables_in_test
|
|
t1
|
|
t2
|
|
SELECT COUNT(*) FROM t1;
|
|
COUNT(*)
|
|
1
|
|
SELECT COUNT(*) FROM t2;
|
|
COUNT(*)
|
|
1
|
|
USE replica;
|
|
INSERT INTO replica.t1 VALUES(2, repeat('def',200));
|
|
INSERT INTO replica.t2 VALUES(2, repeat('def',200));
|
|
SHOW TABLES;
|
|
Tables_in_replica
|
|
t1
|
|
t2
|
|
SELECT COUNT(*) FROM t1;
|
|
COUNT(*)
|
|
1
|
|
SELECT COUNT(*) FROM t2;
|
|
COUNT(*)
|
|
1
|
|
SHOW TABLES;
|
|
Tables_in_test
|
|
USE replica;
|
|
SHOW TABLES;
|
|
Tables_in_replica
|
|
t1
|
|
t2
|
|
SELECT COUNT(*) FROM t1;
|
|
COUNT(*)
|
|
1
|
|
SELECT COUNT(*) FROM t2;
|
|
COUNT(*)
|
|
1
|
|
USE test;
|
|
SHOW TABLES;
|
|
Tables_in_test
|
|
USE test;
|
|
DROP TABLE t1, t2;
|
|
DROP DATABASE IF EXISTS replica;
|
|
include/rpl_end.inc
|