2001-01-04 01:56:38 +01:00
|
|
|
connect (master,localhost,root,,test,0,mysql-master.sock);
|
|
|
|
connect (slave,localhost,root,,test,0,mysql-slave.sock);
|
|
|
|
source include/have_default_master.inc;
|
2000-12-15 01:43:13 +01:00
|
|
|
system cat /dev/null > var/slave-data/master.info;
|
|
|
|
system chmod 000 var/slave-data/master.info;
|
|
|
|
connection slave;
|
|
|
|
!slave start;
|
|
|
|
system chmod 600 var/slave-data/master.info;
|
|
|
|
!slave start;
|
|
|
|
!change master to master_host='127.0.0.1',master_port=9306,master_user='root';
|
|
|
|
reset slave;
|
|
|
|
!change master to master_host='127.0.0.1',master_port=9306,master_user='root';
|
2001-01-22 20:35:16 +01:00
|
|
|
connection master;
|
|
|
|
reset master;
|
|
|
|
connection slave;
|
2000-12-15 01:43:13 +01:00
|
|
|
slave start;
|
|
|
|
connection master;
|
2001-01-03 01:15:48 +01:00
|
|
|
drop table if exists t1;
|
|
|
|
create table t1 (s text);
|
|
|
|
insert into t1 values('Could not break slave'),('Tried hard');
|
2001-01-17 13:47:33 +01:00
|
|
|
save_master_pos;
|
2000-12-15 01:43:13 +01:00
|
|
|
connection slave;
|
2001-01-17 13:47:33 +01:00
|
|
|
sync_with_master;
|
2001-01-22 20:35:16 +01:00
|
|
|
show slave status;
|
2001-01-03 01:15:48 +01:00
|
|
|
select * from t1;
|
2000-12-15 04:17:18 +01:00
|
|
|
connection master;
|
|
|
|
flush logs;
|
2001-01-03 01:15:48 +01:00
|
|
|
drop table if exists t2;
|
|
|
|
create table t2(m int);
|
|
|
|
insert into t2 values (34),(67),(123);
|
2000-12-15 04:17:18 +01:00
|
|
|
flush logs;
|
|
|
|
show master logs;
|
|
|
|
purge master logs to 'master-bin.003';
|
|
|
|
show master logs;
|
2001-01-03 01:15:48 +01:00
|
|
|
insert into t2 values (65);
|
2001-01-17 13:47:33 +01:00
|
|
|
save_master_pos;
|
2000-12-15 04:17:18 +01:00
|
|
|
connection slave;
|
2001-01-17 13:47:33 +01:00
|
|
|
sync_with_master;
|
2001-01-22 20:35:16 +01:00
|
|
|
show slave status;
|
2001-01-03 01:15:48 +01:00
|
|
|
select * from t2;
|
|
|
|
drop table if exists t1,t2;
|
2001-01-17 13:47:33 +01:00
|
|
|
connection master;
|
|
|
|
drop table if exists t1,t2;
|