在开发的时候经常会想看一下MySQL最终执行的sql或者想保存sql记录,所以我们可以启用MySQL的sql记录功能。
开启方法:
编辑MySQL的my.cnf文件,在文件的[mysqld]节点最下面添加下面的文本:
log-output=FILEgeneral-log=1general_log_file=mysql-general.log
最后重启一下MySQL服务就可以了,最后会 记录在mysql的data/mysql-general.log文件中。
Statement: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