标签:style io ar color os sp on 文件 2014
因为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文件,
[root@centos1 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‘, ‘b0@bf.cn‘, ‘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)
[root@centos1 mysql]#
执行了两个insert
标签:style io ar color os sp on 文件 2014
原文地址:http://www.cnblogs.com/stay-sober/p/4158918.html