Ho il mio slave impostato per non replicare il database 'mysql' come descritto in questo 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
Ora, se vado sul server MASTER e lancio un GRANT
e FLUSH PRIVILEGES
:
GRANT SELECT ON *.* TO `foo`@`localhost` IDENTIFIED BY 'bar';
FLUSH PRIVILEGES;
Quindi torno al server SLAVE ed emetto:
SHOW GRANTS FOR `foo`@`localhost`;
e ricevi la risposta:
+-------------------------------------------------------------------------------------------------------------+
| Grants for foo@localhost |
+-------------------------------------------------------------------------------------------------------------+
| GRANT SELECT ON *.* TO 'foo'@'localhost' IDENTIFIED BY PASSWORD '*E8D46CE25265E545D225A8A6F1BAF642FEBEE5CB' |
+-------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
Come posso impedire allo slave di replicare le modifiche al database mysql? Ho pensato che 'replicate_ignore_db' sarebbe stato sufficiente.
_do_
e_ignore_
clausole. Diventa complicato.