2000-12-14 17:43:13 -07:00
|
|
|
connect (master,localhost,root,,test,0,var/tmp/mysql.sock);
|
|
|
|
connect (slave,localhost,root,,test,0,var/tmp/mysql-slave.sock);
|
|
|
|
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';
|
|
|
|
slave start;
|
|
|
|
connection master;
|
|
|
|
drop table if exists foo;
|
|
|
|
create table foo(s text);
|
|
|
|
insert into foo values('Could not break slave'),('Tried hard');
|
|
|
|
connection slave;
|
|
|
|
sleep 0.3;
|
|
|
|
select * from foo;
|
2000-12-14 20:17:18 -07:00
|
|
|
connection master;
|
|
|
|
flush logs;
|
|
|
|
drop table if exists bar;
|
|
|
|
create table bar(m int);
|
|
|
|
insert into bar values (34),(67),(123);
|
|
|
|
flush logs;
|
|
|
|
sleep 0.3;
|
|
|
|
show master logs;
|
|
|
|
purge master logs to 'master-bin.003';
|
|
|
|
show master logs;
|
|
|
|
insert into bar values (65);
|
|
|
|
connection slave;
|
|
|
|
sleep 0.3;
|
|
|
|
select * from bar;
|