1
by brian
clean slate |
1 |
stop slave;
|
2 |
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
|
3 |
reset master;
|
|
4 |
reset slave;
|
|
5 |
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
|
6 |
start slave;
|
|
7 |
**** On Master ****
|
|
8 |
CREATE TABLE t1 (a INT);
|
|
9 |
INSERT INTO t1 VALUES (1),(2),(3);
|
|
10 |
SELECT * FROM t1;
|
|
11 |
a
|
|
12 |
1
|
|
13 |
2
|
|
14 |
3
|
|
15 |
REPLACE INTO t1 VALUES (4);
|
|
16 |
SELECT * FROM t1;
|
|
17 |
a
|
|
18 |
1
|
|
19 |
2
|
|
20 |
3
|
|
21 |
4
|
|
22 |
**** On Slave ****
|
|
23 |
SELECT * FROM t1;
|
|
24 |
a
|
|
25 |
1
|
|
26 |
2
|
|
27 |
3
|
|
28 |
SHOW SLAVE STATUS;
|
|
29 |
Slave_IO_State #
|
|
30 |
Master_Host 127.0.0.1
|
|
31 |
Master_User root
|
|
32 |
Master_Port MASTER_PORT
|
|
33 |
Connect_Retry 1
|
|
34 |
Master_Log_File #
|
|
35 |
Read_Master_Log_Pos #
|
|
36 |
Relay_Log_File #
|
|
37 |
Relay_Log_Pos #
|
|
38 |
Relay_Master_Log_File master-bin.000001
|
|
39 |
Slave_IO_Running Yes
|
|
40 |
Slave_SQL_Running No
|
|
41 |
Replicate_Do_DB
|
|
42 |
Replicate_Ignore_DB
|
|
43 |
Replicate_Do_Table
|
|
44 |
Replicate_Ignore_Table
|
|
45 |
Replicate_Wild_Do_Table
|
|
46 |
Replicate_Wild_Ignore_Table
|
|
47 |
Last_Errno 1590
|
|
48 |
Last_Error The incident LOST_EVENTS occured on the master. Message: <none>
|
|
49 |
Skip_Counter 0
|
|
50 |
Exec_Master_Log_Pos #
|
|
51 |
Relay_Log_Space #
|
|
52 |
Until_Condition None
|
|
53 |
Until_Log_File
|
|
54 |
Until_Log_Pos 0
|
|
55 |
Master_SSL_Allowed No
|
|
56 |
Master_SSL_CA_File
|
|
57 |
Master_SSL_CA_Path
|
|
58 |
Master_SSL_Cert
|
|
59 |
Master_SSL_Cipher
|
|
60 |
Master_SSL_Key
|
|
61 |
Seconds_Behind_Master #
|
|
62 |
Master_SSL_Verify_Server_Cert No
|
|
63 |
Last_IO_Errno 0
|
|
64 |
Last_IO_Error
|
|
65 |
Last_SQL_Errno 1590
|
|
66 |
Last_SQL_Error The incident LOST_EVENTS occured on the master. Message: <none>
|
|
67 |
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
|
|
68 |
START SLAVE;
|
|
69 |
SELECT * FROM t1;
|
|
70 |
a
|
|
71 |
1
|
|
72 |
2
|
|
73 |
3
|
|
74 |
4
|
|
75 |
SHOW SLAVE STATUS;
|
|
76 |
Slave_IO_State #
|
|
77 |
Master_Host 127.0.0.1
|
|
78 |
Master_User root
|
|
79 |
Master_Port MASTER_PORT
|
|
80 |
Connect_Retry 1
|
|
81 |
Master_Log_File #
|
|
82 |
Read_Master_Log_Pos #
|
|
83 |
Relay_Log_File #
|
|
84 |
Relay_Log_Pos #
|
|
85 |
Relay_Master_Log_File master-bin.000002
|
|
86 |
Slave_IO_Running Yes
|
|
87 |
Slave_SQL_Running Yes
|
|
88 |
Replicate_Do_DB
|
|
89 |
Replicate_Ignore_DB
|
|
90 |
Replicate_Do_Table
|
|
91 |
Replicate_Ignore_Table
|
|
92 |
Replicate_Wild_Do_Table
|
|
93 |
Replicate_Wild_Ignore_Table
|
|
94 |
Last_Errno 0
|
|
95 |
Last_Error
|
|
96 |
Skip_Counter 0
|
|
97 |
Exec_Master_Log_Pos #
|
|
98 |
Relay_Log_Space #
|
|
99 |
Until_Condition None
|
|
100 |
Until_Log_File
|
|
101 |
Until_Log_Pos 0
|
|
102 |
Master_SSL_Allowed No
|
|
103 |
Master_SSL_CA_File
|
|
104 |
Master_SSL_CA_Path
|
|
105 |
Master_SSL_Cert
|
|
106 |
Master_SSL_Cipher
|
|
107 |
Master_SSL_Key
|
|
108 |
Seconds_Behind_Master #
|
|
109 |
Master_SSL_Verify_Server_Cert No
|
|
110 |
Last_IO_Errno 0
|
|
111 |
Last_IO_Error
|
|
112 |
Last_SQL_Errno 0
|
|
113 |
Last_SQL_Error
|
|
114 |
DROP TABLE t1;
|