69 lines
2.6 KiB
Plaintext
69 lines
2.6 KiB
Plaintext
include/master-slave.inc [rpl_server_count=3]
|
|
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]
|
|
CREATE TABLE t1 (c1 CHAR(15), c2 CHAR(15), c3 INT, PRIMARY KEY (c3)) ENGINE = NDB ;
|
|
CREATE TABLE t2 (a int key) ENGINE = NDB ;
|
|
reset master;
|
|
SHOW TABLES;
|
|
Tables_in_test
|
|
t1
|
|
t2
|
|
INSERT INTO t1 VALUES ("row1","will go away",1);
|
|
SELECT * FROM t1 ORDER BY c3;
|
|
c1 c2 c3
|
|
row1 will go away 1
|
|
SELECT * FROM t1 ORDER BY c3;
|
|
c1 c2 c3
|
|
row1 will go away 1
|
|
SELECT @the_epoch:=MAX(epoch) FROM mysql.ndb_apply_status;
|
|
@the_epoch:=MAX(epoch)
|
|
<the_epoch>
|
|
Warnings:
|
|
<the_epoch> 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'.
|
|
SELECT * FROM t1 ORDER BY c3;
|
|
c1 c2 c3
|
|
row1 will go away 1
|
|
stop slave;
|
|
set SQL_LOG_BIN=0;
|
|
insert into t2 values (1);
|
|
include/show_binlog_events.inc
|
|
Log_name Pos Event_type Server_id End_log_pos Info
|
|
master-bin.000001 # Query # # BEGIN
|
|
master-bin.000001 # Table_map # # table_id: # (test.t1)
|
|
master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status)
|
|
master-bin.000001 # Write_rows # # table_id: #
|
|
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
|
|
master-bin.000001 # Query # # COMMIT
|
|
set SQL_LOG_BIN=1;
|
|
include/rpl_change_topology.inc [new topology=3->2]
|
|
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.
|
|
include/start_slave.inc
|
|
INSERT INTO t1 VALUES ("row2","will go away",2),("row3","will change",3),("row4","D",4);
|
|
DELETE FROM t1 WHERE c3 = 1;
|
|
UPDATE t1 SET c2="should go away" WHERE c3 = 2;
|
|
UPDATE t1 SET c2="C" WHERE c3 = 3;
|
|
DELETE FROM t1 WHERE c3 = 2;
|
|
SELECT * FROM t1 ORDER BY c3;
|
|
c1 c2 c3
|
|
row3 C 3
|
|
row4 D 4
|
|
INSERT INTO t1 VALUES ("row5","E",5);
|
|
SELECT * FROM t1 ORDER BY c3;
|
|
c1 c2 c3
|
|
row3 C 3
|
|
row4 D 4
|
|
row5 E 5
|
|
SELECT * FROM t1 ORDER BY c3;
|
|
c1 c2 c3
|
|
row3 C 3
|
|
row4 D 4
|
|
row5 E 5
|
|
==== clean up ====
|
|
DROP TABLE t1;
|
|
DROP TABLE t2;
|
|
include/rpl_end.inc
|