Log of MySQL

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.