ErrorCode:1418
ThisfunctionhasnoneofDETERMINISTIC,NOSQL,orREADSSQLDATAinitsdeclarationandbinaryloggingisenabled(you*might*wanttousethelesssafelog_bin_trust_function_creatorsvariable)
(0mstaken)
解决方法如下:
1. mysql> SET GLOBAL log_bin_trust_function_creators = 1;
2. 系统启动时 --log-bin-trust-function-creators=1
3. 在my.ini(linux下为my.conf)文件中 [mysqld] 标记后加一行内容为 log-bin-trust-function-creators
如果在create function的时候有 1418的错语的时候:那么只需要执行set global log_bin_trust_routine_creators=1;
然后怎么create function 都不会有问题(当然,你的function必段正确哦),这是mysql的一个bug,搞不懂为什么,反正这样做就OK了.
另外,也可以直接在配置文件my.cnf中添加如下行[mysqld] log_bin_trust_routine_creators=1;
这个命令可以在sql editor的环境中运行,并不需要重新启动服务哦。
ThisfunctionhasnoneofDETERMINISTIC,NOSQL,orREADSSQLDATAinitsdeclarationandbinaryloggingisenabled(you*might*wanttousethelesssafelog_bin_trust_function_creatorsvariable)
(0mstaken)
解决方法如下:
1. mysql> SET GLOBAL log_bin_trust_function_creators = 1;
2. 系统启动时 --log-bin-trust-function-creators=1
3. 在my.ini(linux下为my.conf)文件中 [mysqld] 标记后加一行内容为 log-bin-trust-function-creators
如果在create function的时候有 1418的错语的时候:那么只需要执行set global log_bin_trust_routine_creators=1;
然后怎么create function 都不会有问题(当然,你的function必段正确哦),这是mysql的一个bug,搞不懂为什么,反正这样做就OK了.
另外,也可以直接在配置文件my.cnf中添加如下行[mysqld] log_bin_trust_routine_creators=1;
这个命令可以在sql editor的环境中运行,并不需要重新启动服务哦。
本文详细介绍了如何解决MySQL中遇到的1418错误,该错误通常发生在尝试创建函数时,且二进制日志已启用。通过设置全局变量log_bin_trust_function_creators为1,可以避免此问题。同时提供了在不同环境(如命令行、配置文件等)中应用此设置的方法。
1063

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



