开发人员创建funcation,报一下错误
- Error Code : 1418
- 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)
- (0 ms taken)
经过查找官方文档找到解决办法:
http://dev.mysql.com/doc/refman/5.0/en/stored-programs-logging.html
办法1:mysql>
SET GLOBAL log_bin_trust_function_creators = 1;优点:执行后立即生效
缺点:mysql重启后失效,执行再执行上述命令一次。
办法2:
在my.cnf中添加
[mysqld]
log-bin-trust-function-creators=1
优点:永久生效
缺点:重启mysql后才能生效,对于生产库还是用第一种办法稳妥。
阅读(3030) | 评论(0) | 转发(0) |