2004-07-15 03:19:07 +02:00
|
|
|
connect (master,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK);
|
2003-01-28 07:38:28 +01:00
|
|
|
connect (slave,localhost,root,,test,$SLAVE_MYPORT,slave.sock);
|
2000-12-13 17:58:26 +01:00
|
|
|
connection master;
|
|
|
|
reset master;
|
|
|
|
show master status;
|
2001-01-22 20:35:16 +01:00
|
|
|
save_master_pos;
|
2000-12-13 17:58:26 +01:00
|
|
|
connection slave;
|
|
|
|
reset slave;
|
2001-12-15 03:41:20 +01:00
|
|
|
--replace_result $MASTER_MYPORT MASTER_PORT
|
2003-12-19 22:40:23 +01:00
|
|
|
--replace_column 1 # 8 # 9 # 23 # 33 #
|
2000-12-13 17:58:26 +01:00
|
|
|
show slave status;
|
2002-03-16 02:44:44 +01:00
|
|
|
|
2000-12-13 17:58:26 +01:00
|
|
|
change master to master_host='127.0.0.1';
|
2001-12-15 03:41:20 +01:00
|
|
|
# The following needs to be cleaned up when change master is fixed
|
2004-06-11 18:26:13 +02:00
|
|
|
--replace_result $MASTER_MYPORT MASTER_PORT $MYSQL_TCP_PORT MASTER_PORT
|
2003-12-19 22:40:23 +01:00
|
|
|
--replace_column 1 # 8 # 9 # 23 # 33 #
|
2000-12-13 17:58:26 +01:00
|
|
|
show slave status;
|
2001-12-15 03:41:20 +01:00
|
|
|
--replace_result $MASTER_MYPORT MASTER_PORT
|
2001-04-18 07:06:00 +02:00
|
|
|
eval change master to master_host='127.0.0.1',master_user='root',
|
|
|
|
master_password='',master_port=$MASTER_MYPORT;
|
2001-12-15 03:41:20 +01:00
|
|
|
--replace_result $MASTER_MYPORT MASTER_PORT
|
2003-12-19 22:40:23 +01:00
|
|
|
--replace_column 1 # 8 # 9 # 23 # 33 #
|
2000-12-13 17:58:26 +01:00
|
|
|
show slave status;
|
2002-10-25 01:46:14 +02:00
|
|
|
start slave;
|
2001-01-22 20:35:16 +01:00
|
|
|
sync_with_master;
|
2001-12-15 03:41:20 +01:00
|
|
|
--replace_result $MASTER_MYPORT MASTER_PORT
|
2003-12-19 22:40:23 +01:00
|
|
|
--replace_column 1 # 8 # 9 # 23 # 33 #
|
2000-12-13 17:58:26 +01:00
|
|
|
show slave status;
|
|
|
|
connection master;
|
2003-01-06 00:48:59 +01:00
|
|
|
--disable_warnings
|
2001-04-18 03:23:14 +02:00
|
|
|
drop table if exists t1;
|
2003-01-06 00:48:59 +01:00
|
|
|
--enable_warnings
|
2005-12-22 06:39:02 +01:00
|
|
|
create table t1 (n int, PRIMARY KEY(n));
|
2001-04-18 03:23:14 +02:00
|
|
|
insert into t1 values (10),(45),(90);
|
2002-10-25 01:46:14 +02:00
|
|
|
sync_slave_with_master;
|
2005-12-22 06:39:02 +01:00
|
|
|
connection slave;
|
2001-04-18 03:23:14 +02:00
|
|
|
select * from t1;
|
2001-01-03 01:15:48 +01:00
|
|
|
connection master;
|
2005-12-22 06:39:02 +01:00
|
|
|
select * from t1;
|
2001-04-18 03:23:14 +02:00
|
|
|
drop table t1;
|
2002-10-25 01:46:14 +02:00
|
|
|
sync_slave_with_master;
|