Saya memiliki set budak saya untuk tidak mereplikasi database 'mysql' seperti yang dijelaskan dalam ini SHOW SLAVE STATUS\G;
Slave_IO_State: Waiting for master to send event
Master_Host: 127.0.0.1
Master_User: replication
Master_Port: 3306
Connect_Retry: 60
Master_Log_File: master-bin.000001
Read_Master_Log_Pos: 1660
Relay_Log_File: mysql-relay-bin.000004
Relay_Log_Pos: 478
Relay_Master_Log_File: master-bin.000001
Slave_IO_Running: Yes
Slave_SQL_Running: Yes
Replicate_Do_DB:
**Replicate_Ignore_DB: mysql**
Replicate_Do_Table:
Replicate_Ignore_Table:
Replicate_Wild_Do_Table:
Replicate_Wild_Ignore_Table:
Last_Errno: 0
Last_Error:
Skip_Counter: 0
Exec_Master_Log_Pos: 1660
Relay_Log_Space: 633
Until_Condition: None
Until_Log_File:
Until_Log_Pos: 0
Sekarang, jika saya pergi ke server MASTER dan mengeluarkan a GRANT
dan FLUSH PRIVILEGES
:
GRANT SELECT ON *.* TO `foo`@`localhost` IDENTIFIED BY 'bar';
FLUSH PRIVILEGES;
Saya kemudian kembali ke server SLAVE dan mengeluarkan:
SHOW GRANTS FOR `foo`@`localhost`;
dan menerima respons:
+-------------------------------------------------------------------------------------------------------------+
| Grants for foo@localhost |
+-------------------------------------------------------------------------------------------------------------+
| GRANT SELECT ON *.* TO 'foo'@'localhost' IDENTIFIED BY PASSWORD '*E8D46CE25265E545D225A8A6F1BAF642FEBEE5CB' |
+-------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
Bagaimana saya bisa menghentikan budak dari mereplikasi perubahan database mysql? Saya pikir 'replicate_ignore_db' sudah cukup.
_do_
dan_ignore_
klausa. Itu menjadi rumit.