I have a fairly trivial master-master setup. When testing this setup I see that mysql users are binlogged and replicated on slaves. However on each of the masters the binlog-do-db* is for a specific database only:
+------------------+----------+--------------+------------------+
| File | Position | Binlog_Do_DB | Binlog_Ignore_DB |
+------------------+----------+--------------+------------------+
| mysql-bin.000001 | 694 | my_db | |
+------------------+----------+--------------+------------------+
Why are DDL queries like (CREATE USER) and inserts into mysql.user
logged as well? I can't see any mechanisms/configs in the manual which explain this, seemingly, exception.
If it matters, the binlog format is:
mysql> show variables like 'binlog_format';
+---------------+-----------+
| Variable_name | Value |
+---------------+-----------+
| binlog_format | STATEMENT |
+---------------+-----------+
* = Let's forget about the bad-practice of using binlog-do-db for now
USER
info is in the databasemysql
.