MySQL Log management analysis Debugging instance

Source: Internet
Author: User
Tags execution log sql mysql query

The following article mainly describes the MySQL operation log to see the actual operation steps and the actual operation steps of the specific description, if you encounter similar situation in the actual operation, but you do not know how to solve it correctly, then the following article for you must be a mentor.

Just contact with MySQL soon, found that the lack of more enterprise-class features, want real-time view of MySQL executed SQL statements, similar to the event Profiler in MSSQL, Internet search, can only perform operations written to the log, the practice is as follows:

Set the My.ini file, my MySQL installation environment is XP SP2, the file in C:\windows\. , open the file to modify

[MySQLd]

Basedir=e:/mysql 4.0.12

#bind-address=192.168.15.196

Datadir=e:/mysql 4.0.12/data

#language =e:/mysql 4.0.12/share/your Language directory

#slow Query Log#=slowqueris.log

#tmpdir #=

#port =3306

#set-variable=key_buffer=16m

Long_query_time = 1--refers to the execution of more than how long SQL will be log down, here is 1 seconds

Log-slow-queries=slowqueris.log--Log the query back to a slower statement

Log-queries-not-using-indexes = nouseindex.log--literally, log down. Query with no index

Log=mylog.log--Record all execution statements

When the above parameters are turned on, the MySQL performance may be affected, and the recommended shutdown in the production environment




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.