MySQL Log File

Source: Internet
Author: User

Today, I read the previous part of MySQL performance tuning and architecture design. I saw the log file and actually did a test. Here I will summarize it.

I am using MySQL under windows, and there is a lot of content in MySQL under Linux on the Internet. Here the right should be a little bit supplemented.

MySQL has the following types of log files:

    1. Error Log: records errors during database startup, operation, and stop;
    2. Binary log: records all statements for modifying database data;
    3. Update log: records the statement for changing data. It is not recommended to use it. It is replaced by binary logs;
    4. Query log: records the client connection and executed SQL statements;
    5. Slow query log: records all statements whose execution time exceeds the maximum SQL Execution time (long_query_time) or whose indexes are not used;
    6. InnoDB's online redo log: InnoDB is a transaction-safe storage engine. Its transaction security is mainly guaranteed by the online redo log and the Undo information recorded in the tablespace.
The configuration items corresponding to the preceding log file are shown in the following table:
Error Log -- Log-error = [filename]
Binary log -- Log-bin [= file_name]
Update log This log is no longer supported in version 5.0 or later
Query logs -- Log [= fina_name]
Slow query log -- Log-Slow-queries [= file_name]
InnoDB online redo logs It can only change its storage location
   

We can configure these log files using two paths. Here we take the configuration of querying logs and binary logs as an example.

1. Configure in my. ini file, that is, add the following content at the end of my. ini file:
 
Log-error = c: \ err. loglog = c: \ log. Log

Then restart the MySQL service to view the log files in drive C. Use this method to view other log files.

2. specify when starting the MySQL service: First stop MySQL, and then jump to the MySQL installation directory. For example, you can see the full name MEW under drive C. log query log files. If you need to enable other logs, add the mysqld file. For example:
Mysqld -- log = "C: \ new. log" -- log-error = "C: \ error. log"

Yes, this log enabling method is complete.

Related Article

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.