| 1 |
include/master-slave.inc |
| 2 |
[connection master] |
| 3 |
==== Create new replication user ==== |
| 4 |
connection master; |
| 5 |
GRANT REPLICATION SLAVE ON *.* TO [email protected] IDENTIFIED BY 'rpl'; |
| 6 |
connection slave; |
| 7 |
include/stop_slave.inc |
| 8 |
set @save_relay_log_purge=@@global.relay_log_purge; |
| 9 |
set @@global.relay_log_purge=0; |
| 10 |
CHANGE MASTER TO master_user='rpl', master_password='rpl'; |
| 11 |
select @@global.relay_log_purge; |
| 12 |
@@global.relay_log_purge |
| 13 |
0 |
| 14 |
set @@global.relay_log_purge=1; |
| 15 |
CHANGE MASTER TO master_user='rpl', master_password='rpl'; |
| 16 |
select @@global.relay_log_purge; |
| 17 |
@@global.relay_log_purge |
| 18 |
1 |
| 19 |
set @@global.relay_log_purge=@save_relay_log_purge; |
| 20 |
CHANGE MASTER TO master_user='rpl', master_password='rpl'; |
| 21 |
include/start_slave.inc |
| 22 |
==== Do replication as new user ==== |
| 23 |
connection master; |
| 24 |
CREATE TABLE t1 (n INT); |
| 25 |
INSERT INTO t1 VALUES (1); |
| 26 |
connection slave; |
| 27 |
SELECT * FROM t1; |
| 28 |
n |
| 29 |
1 |
| 30 |
==== Delete new replication user ==== |
| 31 |
connection master; |
| 32 |
DROP USER [email protected]; |
| 33 |
FLUSH PRIVILEGES; |
| 34 |
connection slave; |
| 35 |
==== Restart slave without privileges ===== |
| 36 |
include/stop_slave.inc |
| 37 |
START SLAVE; |
| 38 |
include/wait_for_slave_sql_to_start.inc |
| 39 |
==== Verify that Slave IO thread stopped with error ==== |
| 40 |
include/wait_for_slave_io_error.inc [errno=1045] |
| 41 |
==== Cleanup (Note that slave IO thread is not running) ==== |
| 42 |
include/stop_slave_sql.inc |
| 43 |
CHANGE MASTER TO MASTER_USER = 'root', MASTER_PASSWORD = ''; |
| 44 |
include/rpl_reset.inc |
| 45 |
connection master; |
| 46 |
DROP TABLE t1; |
| 47 |
include/rpl_end.inc |