MySQL创建Function时报的1418错误代号解决办法
2013-09-24 14:14
501 查看
以下是引用片段:
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的环境中运行,并不需要重新启动服务哦。
MySQL自5.0之後終於支援SP( Store Procedures ),
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) Assessment of the nature of a function is based on the “honesty” of the creator: MySQL does not check that a function declared DETERMINISTIC is free of statements that produce non-deterministic results.
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;
You can also set this variable by using the --log-bin-trust-function-creators=1 option when starting the server.
1. mysql> SET GLOBAL log_bin_trust_function_creators = 1;
2. 系統啟動時,加上--log-bin-trust-function-creators 參數為1
3. 直接在my.ini的[mysqld]區段加上log-bin-trust-function-creators=1
當然我想大多數人會用第三種方法,
ok...繼續我的SP學習,good luck..
二、mysql ERROR 1418 (HY000)
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)
应该是我们开启了bin-log, 我们就必须指定我们的函数是否是
1 DETERMINISTIC 不确定的
2 NO SQL 没有SQl语句,当然也不会修改数据
3 READS SQL DATA 只是读取数据,当然也不会修改数据
4 MODIFIES SQL DATA 要修改数据
5 CONTAINS SQL 包含了SQL语句
其中在function里面,只有 DETERMINISTIC, NO SQL 和 READS SQL DATA 被支持。如果我们开启了 bin-log, 我们就必须为我们的function指定一个参数。
我们可以通过设置如下的参数来关掉这个。
SET GLOBAL log_bin_trust_function_creators = 1;
(you *might* want to use the less safe log_bin_trust_function_creators
variable)
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的环境中运行,并不需要重新启动服务哦。
MySQL自5.0之後終於支援SP( Store Procedures ),
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) Assessment of the nature of a function is based on the “honesty” of the creator: MySQL does not check that a function declared DETERMINISTIC is free of statements that produce non-deterministic results.
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;
You can also set this variable by using the --log-bin-trust-function-creators=1 option when starting the server.
1. mysql> SET GLOBAL log_bin_trust_function_creators = 1;
2. 系統啟動時,加上--log-bin-trust-function-creators 參數為1
3. 直接在my.ini的[mysqld]區段加上log-bin-trust-function-creators=1
當然我想大多數人會用第三種方法,
ok...繼續我的SP學習,good luck..
二、mysql ERROR 1418 (HY000)
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)
应该是我们开启了bin-log, 我们就必须指定我们的函数是否是
1 DETERMINISTIC 不确定的
2 NO SQL 没有SQl语句,当然也不会修改数据
3 READS SQL DATA 只是读取数据,当然也不会修改数据
4 MODIFIES SQL DATA 要修改数据
5 CONTAINS SQL 包含了SQL语句
其中在function里面,只有 DETERMINISTIC, NO SQL 和 READS SQL DATA 被支持。如果我们开启了 bin-log, 我们就必须为我们的function指定一个参数。
我们可以通过设置如下的参数来关掉这个。
SET GLOBAL log_bin_trust_function_creators = 1;
(you *might* want to use the less safe log_bin_trust_function_creators
variable)
相关文章推荐
- MySQL创建Function时报的1418错误代号解决办法
- mysql创建函数出现1418错误的解决办法
- mysql创建函数出现1418错误的解决办法
- mysql 创建函数时出现 Error Code : 1418 错误解决办法
- mysql 创建函数时出现 Error Code : 1418 错误解决办法
- MySQL创建Function时报的1418错误代号解决办法 log_bin_trust_function_creators
- MySQL创建Function时报的1418错误代号解决办法
- MySQL创建外键时报Can't create table (errno: 150)错误解决办法
- 一台机器搭建MySQL双实例并创建主从关系出现1045错误解决办法一则
- 一台机器搭建MySQL双实例并创建主从关系出现1045错误解决办法一则
- MySQL中创建外键参照时的句法错误(errno:150)解决办法
- 安装Mysql时出现错误及解决办法
- mysql-5.7.9-winx64 MySQL服务无法启动,服务没有报告任何错误的解决办法
- 安装mysql,1067错误解决办法
- mysql4.1以上版本连接时出现Client does not support authentication protocol #1251错误问题解决办法
- mysql 错误已经解决办法
- Mysql错误:#1054 - Unknown column 'money' in 'field list' 解决办法
- 使用sqoop 1.4.4从mysql向hdfs导入表出现链接数据库失败错误的解决办法
- 遇到错误-----安装DBD:MySql模块遇到的问题及解决办法Can't exec "mysql_config": 没有那个文件或目录 at Makefile.PL line 479.
- MySQL Daemon failed to start错误解决办法