Home > Database > Mysql Tutorial > mysql打开general log的办法_MySQL

mysql打开general log的办法_MySQL

WBOY
Release: 2016-06-01 13:36:55
Original
1296 people have browsed it

bitsCN.com


mysql打开general log的办法

 

mysql打开general log之后,所有的查询语句都可以在general log

文件中以可读的方式得到,但是这样general log文件会非常大,所以默认

都是关闭的。有的时候为了查错等原因,还是需要暂时打开general log的。 

   

 

mysql@localhost.(none)>show global variables like "%genera%";

+------------------+------------------------------+

| Variable_name | Value |

+------------------+------------------------------+

| general_log | OFF |

| general_log_file | /data1/mysql9999/etch171.log |

+------------------+------------------------------+

2 rows in set (0.00 sec)

 

mysql@localhost.(none)>set global general_log=on;

Query OK, 0 rows affected (0.02 sec)

 

mysql@localhost.(none)>set global general_log=off;

Query OK, 0 rows affected (0.00 sec)

 

bitsCN.com
Related labels:
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