1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
|
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 connection metadata repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START REPLICA; see the 'START REPLICA Syntax' in the MySQL Manual for more information.
[connection master]
create table t1 (n int auto_increment primary key);
set insert_id = 2000;
insert into t1 values (NULL),(NULL),(NULL);
include/sync_slave_sql_with_master.inc
select * from t1;
n
2000
2001
2002
SHOW SLAVE HOSTS;
Server_id Host Port Master_id Slave_UUID
2 127.0.0.1 SLAVE_PORT 1 SLAVE_UUID
Warnings:
Warning 1287 'SHOW SLAVE HOSTS' is deprecated and will be removed in a future release. Please use SHOW REPLICAS instead
drop table t1;
include/sync_slave_sql_with_master.inc
stop slave;
Warnings:
Warning 1287 'STOP SLAVE' is deprecated and will be removed in a future release. Please use STOP REPLICA instead
include/wait_for_slave_to_stop.inc
create table t2(id int auto_increment primary key, created datetime);
set timestamp=12345;
insert into t2 set created=now();
select * from t2;
id created
1 1970-01-01 06:25:45
create table t3 like t2;
create temporary table t4 like t2;
create table t5 select * from t4;
start slave;
Warnings:
Warning 1287 'START SLAVE' is deprecated and will be removed in a future release. Please use START REPLICA instead
include/wait_for_slave_to_start.inc
select * from t2;
id created
1 1970-01-01 06:25:45
show create table t3;
Table Create Table
t3 CREATE TABLE `t3` (
`id` int NOT NULL AUTO_INCREMENT,
`created` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=ENGINE DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci
show create table t5;
Table Create Table
t5 CREATE TABLE `t5` (
`id` int NOT NULL DEFAULT '0',
`created` datetime DEFAULT NULL
) ENGINE=ENGINE DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci
drop table t2,t3,t5;
drop temporary table if exists t4;
include/sync_slave_sql_with_master.inc
include/rpl_end.inc
|