MySQL optimization
' %innodb_flush_log_at_trx_commit% ' ; +--------------------------------+-------+| Variable_name 1 |+--------------------------------+-------+1inset (0.00 sec)
There are three types of default 1 for this value (optional 2 and 0)
Set GLOBAL innodb_flush_log_at_trx_commit=0;
The default value of 1 means that every single transaction commit or out-of-transaction instruction requires the log to be written to (flush) the hard disk, which is time consuming. Especially when using the battery-powered cache (Battery backed up cache). Set to 2 for many applications, especially from the MyISAM table is possible, it means to write to the system cache instead of writing to the hard disk. The log will still flush to the hard drive every second, so you will generally not lose more than 1-2 seconds of updates. Set to 0 will be faster, but the security side is poor, even if MySQL hangs may also lose the transaction data. A value of 2 will only lose data if the entire operating system is hung.
"General Change to 2"
----------------------------------------------------------------------
SELECT @ @GLOBAL. Sql_mode;
If you need to automatically truncate too long data when the database is inserted into the update, use the following
SET @ @GLOBAL. sql_mode="strict_trans_tables";