MySQL创建Function时报的1418错误代号解决办法 |
| 发布时间: 2012/9/20 17:13:15 |
|
以下是引用片段: (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自5.0之後終於支援SP( Store Procedures ), To relax the preceding conditions on function creation (that you must have the SUPER privilege and that a function must be declared deterministic or to not modify data), set the global log_bin_trust_function_creators system variable to 1. By default, this variable has a value of 0, but you can change it like this: mysql> SET GLOBAL log_bin_trust_function_creators = 1; 二、mysql ERROR 1418 (HY000) ERROR 1418 (HY000): This function has none of DETERMINISTIC, NO SQL, 应该是我们开启了bin-log, 我们就必须指定我们的函数是否是
我们可以通过设置如下的参数来关掉这个。 SET GLOBAL log_bin_trust_function_creators = 1; (you *might* want to use the less safe log_bin_trust_function_creators
本文出自:亿恩科技【www.enkj.com】 |
京公网安备41019702002023号