InnoDB System Variables •With a setting of 0, logs are written and flushed to disk once per second. Transactions for which logs have not been flushed can be lost in a crash. •With a setting of 2, logs are written after each transaction commit and flushed to disk once per second. Transactions for which logs have not been flushed can be lost in a crash. •For settings 0 and 2, once-per-second flushing is not 100% guaranteed. Flushing may occur more frequently due to DDL changes and other internal  InnoDB  activities that cause logs to be flushed independently of the  innodb_flush_log_at_trx_commit  setting, and sometimes less frequently due to scheduling issues. If logs are flushed once per second, up to one second of transactions can be lost in a crash. If logs are flushed more or less frequently than once per second, the amount of transactions that can be lost varies accordingly. •Log flushing frequency is controlled by  innodb_flush_log_at_timeout , which allows you to set log flushing frequency to  N  seconds (where  N  is  1 ... 2700 , with a default value of 1). However, any unexpected  mysqld  process exit can erase up to  N  seconds of transactions. •DDL changes and other internal  InnoDB  activities flush the log independently of the innodb_flush_log_at_trx_commit  setting. • InnoDB  crash recovery works regardless of the  innodb_flush_log_at_trx_commit  setting. Transactions are either applied entirely or erased entirely. •If binary logging is enabled, set  sync_binlog=1 . •Always set  innodb_flush_log_at_trx_commit=1 . • innodb_flush_method For durability and consistency in a replication setup that uses  InnoDB  with transactions: For information on the combination of settings on a replica that is most resilient to unexpected halts, see Section 17.4.2, “Handling an Unexpected Halt of a Replica” . Many operating systems and some disk hardware fool the flush-to-disk operation. They may tell  mysqld  that the flush has taken place, even though it has not. In this case, the durability of transactions is not guaranteed even with the recommended settings, and in the worst case, a power outage can corrupt InnoDB  data. Using a battery-backed disk cache in the SCSI disk controller or in the disk itself speeds up file flushes, and makes the operation safer. You can also try to disable the caching of disk writes in hardware caches. Command-Line Format --innodb-flush-method=value System Variable innodb_flush_method Scope Global Dynamic No SET_VAR  Hint Applies No Type String Default Value (Unix) fsync Default Value (Windows) unbuffered 3244 Caution