#### 5.4.4.4 Logging Format for Changes to mysql Database Tables

 The contents of the grant tables in the `mysql` database can be modified directly (for example, with [`INSERT`](insert.html) or [`DELETE`](delete.html)) or indirectly (for example, with [`GRANT`](grant.html) or [`CREATE USER`](create-user.html)). Statements that affect `mysql` database tables are written to the binary log using the following rules:

* Data manipulation statements that change data in `mysql` database tables directly are logged according to the setting of the [`binlog_format`](replication-options-binary-log.html#sysvar_binlog_format) system variable. This pertains to statements such as [`INSERT`](insert.html), [`UPDATE`](update.html), [`DELETE`](delete.html), [`REPLACE`](replace.html), [`DO`](do.html), [`LOAD DATA`](load-data.html), [`SELECT`](select.html), and [`TRUNCATE TABLE`](truncate-table.html).

* Statements that change the `mysql` database indirectly are logged as statements regardless of the value of [`binlog_format`](replication-options-binary-log.html#sysvar_binlog_format). This pertains to statements such as [`GRANT`](grant.html), [`REVOKE`](revoke.html), [`SET PASSWORD`](set-password.html), [`RENAME USER`](rename-user.html), `CREATE` (all forms except [`CREATE TABLE ... SELECT`](create-table.html)), `ALTER` (all forms), and `DROP` (all forms).

[`CREATE TABLE ... SELECT`](create-table.html) is a combination of data definition and data manipulation. The [`CREATE TABLE`](create-table.html) part is logged using statement format and the [`SELECT`](select.html) part is logged according to the value of [`binlog_format`](replication-options-binary-log.html#sysvar_binlog_format).

