mysql_general_log

因为bugfree要新建好多用户,所以用了存储过程。第一次写的凭自己理解,但是登录时,提示了没有产品权限。

想到了打开mysql general_log来看看具体执行的sql。

mysql> show global variables like ‘%general%‘;
+------------------+----------------------------------+
| Variable_name    | Value                            |
+------------------+----------------------------------+
| general_log      | OFF                              |
| general_log_file | /opt/lampp/var/mysql/centos1.log |
+------------------+----------------------------------+
2 rows in set (0.00 sec)

mysql> set global general_log=on;
Query OK, 0 rows affected (0.01 sec)

mysql> show global variables like ‘%general%‘;
+------------------+----------------------------------+
| Variable_name    | Value                            |
+------------------+----------------------------------+
| general_log      | ON                               |
| general_log_file | /opt/lampp/var/mysql/centos1.log |
+------------------+----------------------------------+
2 rows in set (0.03 sec)
打开对应的log文件,

[[email protected] mysql]# cat centos1.log |grep INSERT |tail -3
           59 Query    INSERT INTO `bf_user_log` (`created_by`, `created_at`, `ip`) VALUES (1, ‘2014-12-12 01:09:45‘, ‘192.168.0.1‘)
           72 Query    INSERT INTO `bf_test_user` (`lock_version`, `authmode`, `username`, `realname`, `password`, `email`, `is_dropped`, `email_flag`, `wangwang_flag`, `wangwang`, `created_at`, `updated_at`, `created_by`, `updated_by`, `full_pinyin`, `first_pinyin`) VALUES (1, ‘internal‘, ‘b0‘, ‘b0‘, ‘e10adc3949ba59abbe56e057f20f883e‘, ‘[email protected]‘, ‘0‘, ‘1‘, ‘0‘, ‘‘, ‘2014-12-12 01:10:59‘, ‘2014-12-12 01:10:59‘, 1, 1, ‘b0‘, ‘b0‘)
           72 Query    INSERT INTO `bf_admin_action` (`action_type`, `target_table`, `target_id`, `created_at`, `created_by`) VALUES (‘Open‘, ‘test_user‘, 16, ‘2014-12-12 01:10:59‘, 1)
[[email protected] mysql]#

执行了两个insert

时间: 2024-08-29 20:53:50

mysql_general_log的相关文章

搭建4.xdebug+mysql general_log

1.先把tgz的包在本地解压,把里面的tar包传到 centos的/root目录,使用tar -xvf 解压tar包,解压出了xdebug-2.2.4.package.xml, 2.进入xdebug,执行phpize 3.不报错的话 执行./configure --enable-xdebug 4.make && make install 6.vi /etc/php.ini,后面加入     [Xdebug]     zend_extension ="/usr/lib/php/mo

MySQL 8.0 Docker使用注解

PUBLIC | AUTOMATED BUILD cytopia/mysql-8.0 Last pushed: 8 months ago Repo Info Tags Dockerfile Build Details Short Description MySQL 8.0 on CentOS 7 Full Description MySQL 8.0 Docker <small>Latest build: 2017-08-30</small>     mysql 5.5 | mysq

mysql5.6 主从同步配置

一:配置前说明 在centos 6环境下配置 mysql 5.6主从同步 准备两台测试的虚拟机,2台虚拟机上都安装mysql软件,并开启mysql服务主master : 192.168.1.110从slave : 192.168.1.109 二:配置主库 1: 授权给从数据库服务器 mysql> grant replication slave on *.* to 'rep1'@'192.168.1.109' identified by 'test123456'; Query OK, 0 rows