Compared with Oracle functions, learning Mysql will always find the highlights. Oracle uses the log mining skill to find all records that have been executed. Mysql also provides three methods {verified, I will record specific practices} Method 1: {verified} record all MySQL records turn on etc and compare Oracle functions to learn Mysql will always find highlights
Using the log mining skill in Oracle, you can find all records that have been executed;
Mysql also provides 3 methods {verified, I will record the specific practices}
Method 1: {verified}
Record all MySQL records
Open/etc/my. cnf
Under [mysqld], add
Log =/mnt/mydata/SQL. log
Restart mysql.
View the/mnt/mydata/SQL. log file
Note:
1. because SQL. log has a large number of writes, pay attention to monitoring the size of IO and SQL. log;
2. After debugging or query is complete, we recommend that you disable the function.
Method 2: {not verified yet}
Query the SQL syntax of Slow query:
Log_slow_queries =/var/log/mysql/mysql-slow.log.
Long_query_time = 2 (the SQL syntax is recorded for more than 2 seconds. it is also a method to set a short value to record the exception .)
Method 3: {not verified yet}
Set binlog for MySQL Replication:
Log_bin =/var/log/mysql/mysql-bin.log (this file uses the mysqlbinlog solution to see,
Mysqlbinlog mysql-bin.000042 | grep "T_ABC" | grep "columvalue"
Mysql records all INSERT/UPDATE/DELETE syntaxes here (but the syntax may be different from what you think). This is the log file to be written to SLAVE.