教程集 www.jiaochengji.com
教程集 >  数据库  >  mysql  >  正文 mysql中打开general log的方法

mysql中打开general log的方法

发布时间:2015-10-22   编辑:jiaochengji.com
mysql打开general log之后,所有的查询语句都可以在general log文件中以可读的方式得到,但是这样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)

您可能感兴趣的文章:
mysql中打开general log的方法
mysql general log的配置方法
mysql日志使用浅析
MySQL下FLUSH命令mysql日志的轮询
windows下mysqlcc安装与配置(Config MySQL Control Center)的方法
mysql中Relay log read failure master slave的解决方法
Mysql 多实例启动配置详解
mysql删除mysql-bin.000xxx文件导致mysql无法启动解决方法
mysql打开慢查询日志的方法
MYSQL: Failed to open the relay log解决办法

[关闭]
~ ~