股票hao123,长江电力商务网,ca1309
创建存储过程时
出错信息:
error 1418 (hy000): this function has none of deterministic, no sql, or reads sql data in its declaration and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)
原因:
这是我们开启了bin-log, 我们就必须指定我们的函数是否是
1 deterministic 不确定的
2 no sql 没有sql语句,当然也不会修改数据
3 reads sql data 只是读取数据,当然也不会修改数据
4 modifies sql data 要修改数据
5 contains sql 包含了sql语句
其中在function里面,只有 deterministic, no sql 和 reads sql data 被支持。如果我们开启了 bin-log, 我们就必须为我们的function指定一个参数。
解决方法:
sql code
mysql> show variables like 'log_bin_trust_function_creators';
+---------------------------------+-------+
| variable_name | value |
+---------------------------------+-------+
| log_bin_trust_function_creators | off |
+---------------------------------+-------+
mysql> set global log_bin_trust_function_creators=1;
mysql> show variables like 'log_bin_trust_function_creators';
+---------------------------------+-------+
| variable_name | value |
+---------------------------------+-------+
| log_bin_trust_function_creators | on |
这样添加了参数以后,如果mysqld重启,那个参数又会消失,因此记得在my.cnf配置文件中添加:
log_bin_trust_function_creators=1
如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!!
点击进行留言回复
相关文章:
-
-
-
-
-
-
-
-
-
-
-
mysql事务管理操作详解
本文实例讲述了mysql事务管理操作。分享给大家供大家参考,具体如下:本文内容: 什么是事务管理 事务管理操作 回滚点 默认的事务管理首发日期:2018...
[阅读全文]
网友评论