Home > Database > Mysql Tutorial > 开启MySQL的sql语句记录_MySQL

开启MySQL的sql语句记录_MySQL

WBOY
Release: 2016-06-01 13:11:26
Original
1079 people have browsed it

在开发的时候经常会想看一下MySQL最终执行的sql或者想保存sql记录,所以我们可以启用MySQL的sql记录功能。

开启方法:

编辑MySQL的my.cnf文件,在文件的[mysqld]节点最下面添加下面的文本:

log-output=FILEgeneral-log=1general_log_file=mysql-general.log
Copy after login



最后重启一下MySQL服务就可以了,最后会 记录在mysql的data/mysql-general.log文件中。
source:php.cn
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template