This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its de 错误解决办法

今天线上服务器需要修改下存储过程,语句添加好之后,但是就是报错1418

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)

 

解决方法:

1.在客户端上执行SET GLOBAL log_bin_trust_function_creators = 1;
2.MySQL启动时,加上--log-bin-trust-function-creators选贤,参数设置为1
3.在MySQL配置文件my.ini或my.cnf中的[mysqld]段上加log-bin-trust-function-creators=1

 

然后OK了,后来监控上报错,从服务有问题

mysql> SHOW SLAVE STATUS\G 发现如下报错

Last_SQL_Error: Error '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)' on query. Default database: 'eldb'. Query: 'CREATE DEFINER=`eluadm`@`%` FUNCTION `_Navicat_Temp_Stored_Proc`(xunivId int) RETURNS float

在从服务器上执行下,把slave重启下就OK!

 

posted @ 2013-09-26 16:34  kingtigerhu  阅读(471)  评论(0)    收藏  举报