Mysql Log View _ MySQL

Source: Internet
Author: User
Check whether logs are enabled for bitsCN.com in mysql logs.
Mysql> show variables like 'log _ bin ';

How to know the current log
Mysql> show master status;

Use mysqlbinlog to view binary log files
Shell> mysqlbinlog mail-bin.000001 (to write absolute problem path d ://)
Or shell> mysqlbinlog mail-bin.000001 | tail

Use a similar command in 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 installation directory of mysql, open my. ini, add the above parameters to the end, save and restart the mysql service.
For example:
# Enter a name for the error log file. Otherwise a default name will be used.
Log-error = err. log
# Enter a name for the query log file. Otherwise a default name will be used.
# Log =
# Enter a name for the slow query log file. Otherwise a default name will be used.
# Log-slow-queries =
# Enter a name for the update log file. Otherwise a default name will be used.
# Log-update =
# Enter a name for the binary log. Otherwise a default name will be used.
# Log-bin =
Only error logs are enabled. to enable other logs, remove the preceding.

Long_query_time = 1 -- indicates how long the SQL statement will be logged after execution. here, it is 1 second.

Log-slow-queries = slowqueris. log -- records slow statements returned by the query.

Log-queries-not-using-indexes = nouseindex. log -- it is a literal meaning that the query with no index is used in the log.

Log = mylog. log -- 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


From OO & XX's blog bitsCN.com

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.