Home Database Mysql Tutorial mysql如何跟踪执行的sql语句_MySQL

mysql如何跟踪执行的sql语句_MySQL

May 16, 2018 am 10:04 AM
mysql sql statement windows how

bitsCN.com 在SQL SERVER下跟踪sql采用事件探查器,而在mysql下如何跟踪sql呢?
其实方法很简单,开启mysql的日志log功能,通过查看跟踪日志即可。
开启mysql的日志log方法:
windows环境下的配置方法:

我使用的版本:Version: 5.0.37-community-nt-log (MySQL Community Edition (GPL))

找到my.ini,我的是在“G:/Program Files (x86)/MySQL/MySQL Server 5.0”目录下,

找到[mysqld],在下面添加:

log=存放日志的路径/my.log

我的配置值:

保存文件,重启服务之后,在“G:/Program Files (x86)/MySQL/MySQL Server 5.0/data”目录下可以找到“mySQL.log”文件。

linux下的配置方法:

修改/etc/my.cnf,找到[mysqld],在下面添加:

log=存放日志的路径/my.log

修改完后,记得重启mysql服务哦。 bitsCN.com    

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

Repo: How To Revive Teammates
1 months ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
1 months ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to solve the problem of third-party interface returning 403 in Node.js environment? How to solve the problem of third-party interface returning 403 in Node.js environment? Mar 31, 2025 pm 11:27 PM

Solve the problem of third-party interface returning 403 in Node.js environment. When we use Node.js to call third-party interfaces, we sometimes encounter an error of 403 from the interface returning 403...

The page is blank after PHP is connected to MySQL. What is the reason for the invalid die() function? The page is blank after PHP is connected to MySQL. What is the reason for the invalid die() function? Apr 01, 2025 pm 03:03 PM

The page is blank after PHP connects to MySQL, and the reason why die() function fails. When learning the connection between PHP and MySQL database, you often encounter some confusing things...

How to efficiently integrate Node.js or Python services under LAMP architecture? How to efficiently integrate Node.js or Python services under LAMP architecture? Apr 01, 2025 pm 02:48 PM

Many website developers face the problem of integrating Node.js or Python services under the LAMP architecture: the existing LAMP (Linux Apache MySQL PHP) architecture website needs...

PHP optimistic locking combined with transaction deduction balance failed: How to ensure that the balance is correctly deducted in concurrency situations? PHP optimistic locking combined with transaction deduction balance failed: How to ensure that the balance is correctly deducted in concurrency situations? Mar 31, 2025 pm 11:42 PM

Detailed explanation of the problem of deducting balances in combination with PHP optimistic locks and transactions in this article will analyze in detail a balance deduction using PHP, optimistic locks and database transactions, only...

How to query the sum of two columns of data at the same time in ThinkPHP6? How to query the sum of two columns of data at the same time in ThinkPHP6? Apr 01, 2025 pm 02:54 PM

ThinkPHP6 database query: How to use TP6 to implement SQL statements SELECTSUM(jin), SUM(chu)FROMsysdbuil In ThinkPHP6 framework, how to use SQL statement SELECT...

What should I do if Beyond Compare fails to case sensitivity when synchronizing Windows and Linux files? What should I do if Beyond Compare fails to case sensitivity when synchronizing Windows and Linux files? Apr 01, 2025 am 08:06 AM

The problem of comparing and synchronizing BeyondCompare files: Case sensitivity failure when using Beyond...

How to avoid third-party interfaces returning 403 errors in Node environment? How to avoid third-party interfaces returning 403 errors in Node environment? Apr 01, 2025 pm 02:03 PM

How to avoid the third-party interface returning 403 error in the Node environment. When calling the third-party website interface using Node.js, you sometimes encounter the problem of returning 403 error. �...

See all articles