MySQL executes SQL statements by viewing trace log traces

Source: Internet
Author: User

Tracking SQL under SQL Server uses Profiler, and how do you track sql under MySQL?

In fact, the method is very simple, turn on the log logging function of MySQL, by viewing the trace log.

To turn on MySQL logs log method:

Configuration methods in the Windows environment:

Version I am using: version:5.0.37-community-nt-log (MySQL Community Edition (GPL))

Find My.ini, mine is in the "G:\Program Files (x86) \mysql\mysql Server 5.0" directory,

Locate [mysqld] and add the following:

Log= the path where the log is stored/my.log

My configuration values:



After you save the file and restart the service, you can find the "mySQL.log" file in the "G:\Program files (x86) \mysql\mysql Server 5.0\data" directory.

How to configure Linux:

Modify/ETC/MY.CNF, find [mysqld], add below:

Log= the path where the log is stored/my.log

When you're done, remember to restart the MySQL service.

MySQL executes SQL statements by viewing trace log traces

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.