| 1 |
include/master-slave.inc |
| 2 |
Warnings: |
| 3 |
Note #### Sending passwords in plain text without SSL/TLS is extremely insecure. |
| 4 |
Note #### Storing MySQL user name or password information in the connection metadata repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START REPLICA; see the 'START REPLICA Syntax' in the MySQL Manual for more information. |
| 5 |
[connection master] |
| 6 |
Setup replication and CREATE DATABASE |
| 7 |
[connection master] |
| 8 |
CREATE DATABASE test_readonly; |
| 9 |
Replicate CREATE DATABASE and set read_only on replica |
| 10 |
include/sync_slave_sql_with_master.inc |
| 11 |
set global read_only=1; |
| 12 |
Time delay from CREATE to DROP lets the NDB metadata change monitor lock the schema |
| 13 |
[connection master] |
| 14 |
DROP DATABASE test_readonly; |
| 15 |
Sync DROP statement. If OK, it won't timeout |
| 16 |
include/sync_slave_sql_with_master.inc |
| 17 |
Cleanup |
| 18 |
[connection slave] |
| 19 |
set global read_only=0; |
| 20 |
include/rpl_end.inc |