对于在线的mysql修改如下:
mysql> show variables like 'general%';
Current database: loldb***
+------------------+------------------------+
| Variable_name | Value |
+------------------+------------------------+
| general_log | OFF |
| general_log_file | /data/mysql/var/s4.log |
+------------------+------------------------+
2 rows in set (0.03 sec)
mysql> SET GLOBAL general_log = 1;
然后去查看/data/mysql/var/s4.log 文件的内容,就可以看到sql语句
或在配置文件/etc/my.cnf里面[mysqld]下添加:
log = /data/mysql/var/s4.log
重启mysqld服务
例如类似的文件内容如下;
阅读(1210) | 评论(0) | 转发(0) |