1include/master-slave.inc 2Warnings: 3Note #### Sending passwords in plain text without SSL/TLS is extremely insecure. 4Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information. 5[connection master] 6==== Create new replication user ==== 7[on master] 8GRANT REPLICATION SLAVE ON *.* TO rpl@127.0.0.1 IDENTIFIED BY 'rpl'; 9[on slave] 10include/sync_slave_sql_with_master.inc 11include/stop_slave.inc 12CHANGE MASTER TO master_user='rpl', master_password='rpl'; 13Warnings: 14Note #### Sending passwords in plain text without SSL/TLS is extremely insecure. 15Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information. 16include/start_slave.inc 17==== Do replication as new user ==== 18[on master] 19CREATE TABLE t1 (n INT); 20INSERT INTO t1 VALUES (1); 21[on slave] 22include/sync_slave_sql_with_master.inc 23SELECT * FROM t1; 24n 251 26==== Delete new replication user ==== 27[on master] 28DROP USER rpl@127.0.0.1; 29FLUSH PRIVILEGES; 30[on slave] 31include/sync_slave_sql_with_master.inc 32==== Restart slave without privileges ===== 33include/stop_slave.inc 34START SLAVE; 35include/wait_for_slave_sql_to_start.inc 36include/wait_for_slave_io_to_stop.inc 37==== Verify that Slave IO thread stopped with error ==== 38include/wait_for_slave_io_error.inc [errno=1045] 39==== Cleanup (Note that slave IO thread is not running) ==== 40include/stop_slave_sql.inc 41CHANGE MASTER TO MASTER_USER = 'root', MASTER_PASSWORD = ''; 42Warnings: 43Note #### Sending passwords in plain text without SSL/TLS is extremely insecure. 44Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information. 45include/rpl_reset.inc 46[on master] 47DROP TABLE t1; 48include/rpl_end.inc 49