The Binary Log Server restarts and log flushing do not cause a new general query log file to be generated (although flushing closes and reopens it). To rename the file and create a new one, use the following commands: On Windows, use  rename  rather than  mv . You can also rename the general query log file at runtime by disabling the log: With the log disabled, rename the log file externally (for example, from the command line). Then enable the log again: This method works on any platform and does not require a server restart. To disable or enable general query logging for the current session, set the session  sql_log_off  variable to  ON  or  OFF . (This assumes that the general query log itself is enabled.) Passwords in statements written to the general query log are rewritten by the server not to occur literally in plain text. Password rewriting can be suppressed for the general query log by starting the server with the --log-raw  option. This option may be useful for diagnostic purposes, to see the exact text of statements as received by the server, but for security reasons is not recommended for production use. See also Section 6.1.2.3, “Passwords and Logging” . An implication of password rewriting is that statements that cannot be parsed (due, for example, to syntax errors) are not written to the general query log because they cannot be known to be password free. Use cases that require logging of all statements including those with errors should use the  --log-raw  option, bearing in mind that this also bypasses password rewriting. Password rewriting occurs only when plain text passwords are expected. For statements with syntax that expect a password hash value, no rewriting occurs. If a plain text password is supplied erroneously for such syntax, the password is logged as given, without rewriting. The  log_timestamps  system variable controls the time zone of timestamps in messages written to the general query log file (as well as to the slow query log file and the error log). It does not affect the time zone of general query log and slow query log messages written to log tables, but rows retrieved from those tables can be converted from the local system time zone to any desired time zone with  CONVERT_TZ()  or by setting the session  time_zone  system variable. The binary log contains “events”  that describe database changes such as table creation operations or changes to table data. It also contains events for statements that potentially could have made changes (for example, a  DELETE  which matched no rows), unless row-based logging is used. The binary log also contains information about how long each statement took that updated data. The binary log has two important purposes: •For replication, the binary log on a replication source server provides a record of the data changes to be sent to replicas. The source sends the information contained in its binary log to its replicas, which reproduce those transactions to make the same data changes that were made on the source. See Section 17.2, “Replication Implementation” . shell>  mv  host_name .log  host_name -old.log shell>  mysqladmin flush-logs shell>  mv  host_name -old.log  backup-directory SET GLOBAL general_log = ’OFF’; SET GLOBAL general_log = ’ON’; 5.4.4 The Binary Log 1046