MySQL Open history under windows

Source: Internet
Author: User

Open the My.ini file, under the location installation directory, add an open log configuration, restart MySQL

# SERVER section#----------------------------------------------------------------------# # The following options would Be read by the MySQL Server. Make sure that# you have installed the server correctly (see above) so it reads this # file.#[mysqld]# Set Slow Query LOGL Ong_query_time = 1slow_query_log = 1slow_query_log_file = "Slowquery.log" #Set general Loglog = "Genquery.log"

Slow_query_log_file, log file location can make an absolute path, default in the Data folder.

Long_query_time units are seconds, which means that query statements greater than 1 seconds are recorded in the Slowquery.log file.

Log is the executed SQL statement that will be recorded.

As follows:

150315 12:06:20 2 Query SET profiling=1
2 Query SHOW STATUS
2 Query SHOW STATUS
2 Query Use Jeewx
2 Query SELECT * FROM Weixin_account
2 Query SHOW STATUS
2 Query SELECT query_id, SUM (DURATION) as sum_duration from INFORMATION_SCHEMA. PROFILING GROUP by query_id
2 Query SELECT state as ' Status ', ROUND (sum (DURATION), 7) as ' DURATION ', CONCAT (ROUND (SUM (DURATION)/0.000659*100,3), '% ') As ' Percentage ' from INFORMATION_SCHEMA. PROFILING WHERE query_id=8 GROUP by state
2 Query SELECT * from ' jeewx '. ' Weixin_account ' LIMIT 0
2 Query SHOW COLUMNS from ' jeewx '. ' Weixin_account '
150315 12:12:19 2 Query SET profiling=1
2 Query SHOW STATUS
2 Query SHOW STATUS
2 Query Use Jeewx
2 Query SELECT * FROM Weixin_account
2 Query SHOW STATUS
2 Query SELECT query_id, SUM (DURATION) as sum_duration from INFORMATION_SCHEMA. PROFILING GROUP by query_id
2 Query SELECT state as ' Status ', ROUND (sum (DURATION), 7) as ' DURATION ', CONCAT (ROUND (SUM (DURATION)/0.000351*100,3), '% ') As ' Percentage ' from INFORMATION_SCHEMA. PROFILING WHERE query_id=18 GROUP by state
2 Query SELECT * from ' jeewx '. ' Weixin_account ' LIMIT 0
2 Query SHOW COLUMNS from ' jeewx '. ' Weixin_account '
150315 12:22:39 1 Query ID
150315 12:22:47 1 Query Show Database
150315 12:22:49 1 Query Show databases
150315 12:22:55 1 Query use test
150315 12:23:27 1 Query CREATE TABLE testtable (

ID Integer,

Name varchar (32))
150315 12:23:31 1 Query Show tables

MySQL Open history under windows

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.