Whether the log is enabled
Mysql>show variables like ' log_bin ';
How to know the current log
Mysql> Show master status;
See binary log files with Mysqlbinlog
Shell>mysqlbinlog mail-bin.000001 (to write absolute problem path d://)
or Shell>mysqlbinlog mail-bin.000001 | Tail
A similar command is used under Windows.
MySQL has the following types of logs :
Error log:-log-err
Query log:-log
Slow query log:-log-slow-queries
Update log:-log-update
Binary log:-log-bin
In the MySQL installation directory, open My.ini, followed by the above parameters, save and restart the MySQL service on the line.
For example:
#Enter a name for the error log file. Otherwise a default name would be used.
Log-error=err.log
#Enter a name for the query log file. Otherwise a default name would be used.
#log =
#Enter a name for the slow query log file. Otherwise a default name would be used.
#log-slow-queries=
#Enter a name for the update log file. Otherwise a default name would be used.
#log-update=
#Enter a name for the binary log. Otherwise a default name would be used.
#log-bin=
The above only open the error log, to open the other log to the front of the "#" removed.
Long_query_time =1– is the execution of more than how long SQL will be log down, here is 1 seconds
log-slow-queries=slowqueris.log– the query to return a slower statement to record
Log-queries-not-using-indexes = nouseindex.log– is the literal meaning, log down without using the indexed query
log=mylog.log– to record all execution statements
Log-error=log-error.log
Log=log-query.log
Log-queries-not-using-indexes
log-warnings=2
Log-slow-queries=log-slow-query.log
Log-update=log-update.log
long_query_time=2
Log of MySQL