mysql 复制数据库到其他主机时,报: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) 错误。
错误原因:
MySQL设置默认不允许创建函数。
解决办法:
SET GLOBAL log_bin_trust_function_creators = 1;(重启后失效;存在主从复制时从机必须设置)
或者:
在my.cnf设置log-bin-trust-function-creators=1(设置后重启mysql服务)
本文解决了一个MySQL在尝试复制包含函数的数据库时遇到的错误:ThisfunctionhasnoneofDETERMINISTIC,NOSQL,orREADSSQLDATAinitsdeclarationandbinaryloggingisenabled。介绍了两种解决方法:一是临时设置log_bin_trust_function_creators变量为1;二是修改my.cnf配置文件中的log-bin-trust-function-creators参数。
3424

被折叠的 条评论
为什么被折叠?



