【MySQL案件】ERROR 1418
1.1.1. ERROR 1418
【环境的叙述性说明】
mysql5.0.67
【问题叙述性说明】
当它来到创建存储过程ERROR 1418一个错误。
# 创建函数SQL声明
CREATE FUNCTION `xxx`( num01 int ) RETURNSint(11)
begin
declare mm int default 0;
if (xx) then
set mm = num01*num01*10;
elseif xxx then
set mm = 10;
else
case num01
when 30 then set mm = 111;
when 31 then set mm = 222;
end case;
end if;
return mm;
end
# 报错信息
# ERROR 1418 (HY000) at line xxxxx: Thisfunction has none of DETERMINISTIC, NO SQL, or READS SQL DATA in itsdeclaration and binary logging is enabled (you *might* want to use the lesssafe log_bin_trust_function_creators variable)
【解决方法】
关闭关闭binary log或者改动參数。
此处採用改动參数的方法:
set globallog_bin_trust_function_creators=1;
【报错原因】
By default, for a CREATE FUNCTION
statement to be accepted, at least one of
DETERMINISTIC,
NOSQL, or READS SQL DATA
must be specified explicitly. Otherwise an error occurs:
ERROR1418 (HY000): This function has none of DETERMINISTIC, NO SQL,
or READSSQL DATA in its declaration and binary logging is enabled
(you*might* want to use the less safe log_bin_trust_function_creators
variable)
If you set log_bin_trust_function_creators
to 1, the requirement that functions be
deterministic or not modify data is dropped.
【參考资料】
Command-LineFormat --log-bin-trust-function-creators
Option-FileFormat log-bin-trust-function-creators
SystemVariable Name log_bin_trust_function_creators
VariableScope Global
DynamicVariable Yes
PermittedValues
Type boolean
Default FALSE
This variable applieswhen binary logging is enabled. It controls whether stored function creators canbe trusted not to create stored functions that will cause unsafe events to bewritten to the binary log. If set to
0 (the default), users are not permittedto create or alter stored functions unless they have the
SUPER privilege in addition to the
CREATE ROUTINE or
ALTER ROUTINE privilege. A setting of0 also enforces the restriction that a function must be declared with the
DETERMINISTIC characteristic, or with the
READS SQL DATA or
NO SQL characteristic. If the variable is set to 1, MySQLdoes not enforce these restrictions on stored function creation. This variablealso applies to trigger creation. See
Section19.7, “Binary Logging of Stored Programs”.
版权声明:本文博客原创文章。博客,未经同意,不得转载。
【MySQL案件】ERROR 1418的更多相关文章
- Mysql ERROR 1418 (HY000): This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA
ERROR 1418 (HY000): This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declar ...
- MySQL创建函数报“ERROR 1418 ”错误,不能创建函数
MySQL创建函数报ERROR 1418错误,不能创建函数,根据官方提示是说,不能创建函数可能是一个安全设置方面的配置或功能未开启原因,下面我们一起来看. 错误 ERROR 1418 (HY000 ...
- mysql 创建函数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_f
mysql 创建函数的时候 报错 ERROR 1418 (HY000): This function has none of DETERMINISTIC, NO SQL, or READS SQL D ...
- mysql: Error Codes and Messages
Appendix B. Error Codes and MessagesTable of Contents B.1. Server Error Codes and MessagesB.2. Clien ...
- Discuz! X3搬家后UCenter出现UCenter info: MySQL Query Error解决方案
Discuz! X3 X2.5论坛搬家后 登录UCenter出现报错:UCenter info: MySQL Query ErrorSQL:SELECT value FROM [Table]vars ...
- Mysql update error: Error Code: 1175. You are using safe update mode and you tried to update a table
Mysql update error: Error Code: 1175. You are using safe update mode and you tried to update a table ...
- MySQL Replication Error 处理一例
故障现象 MySQL slave status详情 mysql> show slave status\G *************************** 1. row ********* ...
- mysql启动报错 mysql InnoDB: Error: could not open single-table tablespace file
mysql启动不成功,报错 mysql InnoDB: Error: could not open single-table tablespace file innodb_force_recovery ...
- xampp启动MySQL出现Error: MySQL shutdown unexpectedly.
20175227张雪莹 2018-2019-2 <Java程序设计> xampp启动MySQL出现Error: MySQL shutdown unexpectedly. 问题 本周在学习教 ...
随机推荐
- 【LaTeX排版】LaTeX论文排版<三>
A picture is worth a thousand words(一图胜千言).图在论文中的重要性不言而喻,本文主要解说图的制作与插入. 1.图像的插入 图像能够分为两大类:位图和向量图 ...
- HDU 2828 DLX搜索
Lamp Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submi ...
- Cocos2d-x 3.0 红孩儿私人义务教育 - 第一章 熟人Cocos2d-x 3.0project
Cocos2d-x 3.0 红孩儿私家必修 前言: 时光飞逝,每每看到博客上的回复和微博上的鼓舞,总会认为亏欠大家点什么.停下来太久.总是认为不太对劲,哈哈,时习之吧,望以此勉励大家. 红孩儿C ...
- Web服务器Raspkate的RESTful API
基于轻量型Web服务器Raspkate的RESTful API的实现 在上一篇文章中,我们已经了解了Raspkate这一轻量型Web服务器,今天,我们再一起了解下如何基于Raspkate实现简单的RE ...
- Codeforces Round#308
A题,看样例就知道要求什么, 水过去 #include <stdio.h> #include <string.h> #include <stdlib.h> #i ...
- C# 引用类型与值类型的区别
//引用类型(使用了class) class SomeRef{public Int32 x;} //值类型(使用了struct) struct SomeVal{public Int32 x;} sta ...
- Shiro学习笔记(5)——web集成
Web集成 shiro配置文件shiroini 界面 webxml最关键 Servlet 測试 基于 Basic 的拦截器身份验证 Web集成 大多数情况.web项目都会集成spring.shiro在 ...
- css3仿山猫侧边栏
演示:http://jsfiddle.net/Adce2/ 其主要思想: 1, 先画边栏html. 2, 使用css3分别财产close sidebar-content动图片. 3, 使用css3的k ...
- view和activity的区别(转)
activity相当于控制部分,view相当于显示部分.两者之间是多对多的关系,所有东西必须用view来显示. viewGroup继承自view,实现了ViewManager,ViewParent接口 ...
- oracle错误之 ora-01017
ora-01017 现象描述: scott用户和其它建立的用户,都登的上.但sys和system用户登录不上 方案一(试过,不行): 1,打开目录:F:\app\Administrator\produ ...