Learn MySQL with Oracle features discover the highlights
The ability to log mining in Oracle enables you to find all records that have been previously run;
MySQL also provides 3 methods {verified, I will record the detailed procedure}
Method 1:{Verified}
Record all of MySQL's records
Open/ETC/MY.CNF
Increase below [mysqld]
Log =/mnt/mydata/sql.log
Restart MySQL to
View/mnt/mydata/sql.log File
Attention:
1. Because the Sql.log is due to a large number of writes. Pay attention to monitor IO and sql.log size;
2. After commissioning or query, it is recommended to turn off the change function
Method 2:{temporary not verified}
Check the SQL syntax for slow query:
Log_slow_queries =/var/log/mysql/mysql-slow.log
Long_query_time = 2 (more than 2 seconds of SQL syntax is recorded, it is also a way to set a short point to record the error.)
Method 3:{temporary not verified}
Set MySQL replication with Binlog:
Log_bin =/var/log/mysql/mysql-bin.log (this file is to be seen with the Mysqlbinlog solution.)
Mysqlbinlog mysql-bin.000042| grep "T_ABC" | grep "Column Value"
MySQL will put all insert/update/delete syntax in this (but the syntax may be different from what you think), this is to write to the slave log file
Log MySQL Run SQL