Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2832177
  • 博文数量: 200
  • 博客积分: 2413
  • 博客等级: 大尉
  • 技术积分: 3067
  • 用 户 组: 普通用户
  • 注册时间: 2011-04-01 22:07
文章分类

全部博文(200)

文章存档

2018年(2)

2017年(8)

2016年(35)

2015年(14)

2014年(20)

2013年(24)

2012年(53)

2011年(44)

分类: Mysql/postgreSQL

2012-05-08 17:34:01


开发人员创建funcation,报一下错误

  1. Error Code : 1418
  2. 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)
  3. (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后才能生效,对于生产库还是用第一种办法稳妥。

阅读(2953) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~