开启bin-log日志mysql报错:This function has none of DETERMINISTIC, NO SQL解决办法:

创建存储过程时

出错信息:

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指定一个参数。

解决方法:

1. 修改 log_bin_trust_function_creators 参数值为ON

mysql> show variables like '%log_bin%';

mysql> set global log_bin_trust_function_creators = ON;
2. 编辑my.cnf文件,添加以下参数:
log_bin_trust_function_creators = ON






开启bin-log日志mysql报错:This function has none of DETERMINISTIC, NO SQL解决办法的更多相关文章

  1. Mysql自定义函数之------------This function has none of DETERMINISTIC, NO SQL解决办法

    This function has none of DETERMINISTIC, NO SQL解决办法 创建存储过程时 出错信息: ERROR 1418 (HY000): This function ...

  2. 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

    问题描述 通过Navicat客户端,创建MySQL函数(根据的当前节点查询其左右叶子节点)时报错,报错信息如下: This function has none of DETERMINISTIC, NO ...

  3. Mac下PHP连接MySQL报错"No such file or directory"的解决办法

    首先做个简短的介绍. [说明1]MAC下MYSQL的安装路径: /usr/local/mysql-5.1.63-osx10.6-x86_64 数据库的数据文件在该目录的data文件夹中: 命令文件在b ...

  4. PHP连接MySQL报错"No such file or directory"的解决办法

    好下面说一下连接MYSQL数据库时报错的解决办法. 1,首先确定是mysql_connect()和mysql_pconnect()的问题,故障现象就是函数返回空,而mysql_error()返回“No ...

  5. Navicat 远程连接Docker容器中的mysql 报错:1251 - Client does not support authentication protocol 解决办法。

    出现这个问题 首先进入 1.docker exec -it mysql02 bash      //mysql02是mysql容器的别名 2.mysql -uroot -p 3.输入密码 4.进入my ...

  6. CentOS7安装MySQL报错Failed to start mysqld.service: Unit not found解决办法

    1 ~]# systemctl start mysql.service 要启动MySQL数据库是却是这样的提示 1 ~]# Failed to start mysqld.service: Unit n ...

  7. 抓取https网页时,报错sun.security.validator.ValidatorException: PKIX path building failed 解决办法

    抓取https网页时,报错sun.security.validator.ValidatorException: PKIX path building failed 解决办法 原因是https证书问题, ...

  8. mysql 创建函数This function has none of DETERMINISTIC, NO SQL, or READS

    今天在mysql 5.6上创建函数的时候 发现报错: ERROR 1418 (HY000): This function has none of DETERMINISTIC, NO SQL, or R ...

  9. mysql----------mysql5.7.11导入sql文件时报错This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled

    1.导入sql文件出现如下错误. [Err] 1418 - This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in ...

随机推荐

  1. Win10U盘启动盘制作及Win10系统安装

    准备工具: 1:一个8GU盘 2:下载MediaCreationTool1803.exe程序 及参考文档. 启动盘制作步骤: 1:运行 2:按照截图步骤依次...... 3:制作完成后插拔一下U盘在看 ...

  2. [Swift]LeetCode394. 字符串解码 | Decode String

    Given an encoded string, return it's decoded string. The encoding rule is: k[encoded_string], where ...

  3. [Swift]LeetCode447. 回旋镖的数量 | Number of Boomerangs

    Given n points in the plane that are all pairwise distinct, a "boomerang" is a tuple of po ...

  4. [Swift]LeetCode793. 阶乘函数后K个零 | Preimage Size of Factorial Zeroes Function

    Let f(x) be the number of zeroes at the end of x!. (Recall that x! = 1 * 2 * 3 * ... * x, and by con ...

  5. Kafka对Java程序员有多重要?连阿里都再用它处理亿万级数据统计

    一.了解淘宝Kafka架构 在ActiveMQ.RabbitMQ.RocketMQ.Kafka消息中间件之间,我们为什么要选择Kafka?下面详细介绍一下,2012年9月份我在支付宝做余额宝研发,20 ...

  6. ThinkPHP 数据库操作(四) : 聚合查询、时间查询、高级查询

    聚合查询 在应用中我们经常会用到一些统计数据,例如当前所有(或者满足某些条件)的用户数.所有用户的最大积分.用户的平均成绩等等,ThinkPHP为这些统计操作提供了一系列的内置方法,包括: 用法示例: ...

  7. Python必备库

    Python必备库 --default-timeout=100避免网络延迟错误:-U给管理员权限. Python基础库 pip --default-timeout=100 install -U pyg ...

  8. jupyter-notebook后home页面空白问题

    jupyter-notebook后home页面空白问题 解决方案1   更换默认的浏览器,选择谷歌浏览器,很多360打不开的页面,更换谷歌后都能有效解决,并且确保是最新版本的google浏览器. 解决 ...

  9. 说一说MVC的CSRF(三)

    用途:防止CSRF(跨网站请求伪造). 用法:在View->Form表单中:<%:Html.AntiForgeryToken()%> 在Controller->Action动作 ...

  10. Chorme浏览器渲染MathJax时出现竖线的解决方法

    Chorme浏览器渲染MathJax时出现竖线的原因分析与解决方法 查资料知,Chorme中显示MathJax时出现竖线的原因如下: 新版的Chorme浏览器在解析css时,会对其中的值进行向上取整( ...