博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Mysql 1418 - This function has none of DETERMINISTIC
阅读量:6903 次
发布时间:2019-06-27

本文共 1240 字,大约阅读时间需要 4 分钟。

hot3.png

错误信息 

[Err] 1418 - 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)

[错误] 1418这个函数没有确定性,没有SQL,或读取其声明和二进制日志的SQL数据启用(你可能想使用不安全的log_bin_trust_function_creators变量)

问题解析

    这事因为我们开启了log_bin_trust_function_creators,在function里面,只有 DETERMINISTIC, NO SQLREADS SQL DATA 被支持。如果我们开启了 log_bin, 我们就必须为我们的function指定一个参数。

mysql> show variables like'%func%';+---------------------------------+-------+| Variable_name                   | Value |+---------------------------------+-------+| log_bin_trust_function_creators | OFF   |+---------------------------------+-------+1 row in set

解决方法

    在MySQL中创建函数时出现这种错误的解决方法有两种选择任意一种即可:

  • set global log_bin_trust_function_creators=TRUE;
  • set global log_bin_trust_function_creators=1;
mysql> set GLOBAL log_bin_trust_function_creators= 1;Query OK, 0 rows affectedmysql> show variables like'%func%';+---------------------------------+-------+| Variable_name                   | Value |+---------------------------------+-------+| log_bin_trust_function_creators | ON    |+---------------------------------+-------+1 row in set

 

转载于:https://my.oschina.net/Clarences/blog/909943

你可能感兴趣的文章
【转】ACM训练计划
查看>>
Design Tic-Tac-Toe
查看>>
LeetCode 477: Total Hamming Distance
查看>>
win10安装MarkdownPad 2报错This view has crashed的处理及md简单语法
查看>>
Unity3D - 设计模式 - 工厂模式
查看>>
第二十六课:jQuery对事件对象的修复
查看>>
Leetcode题目:Swap Nodes in Pairs
查看>>
Windows聚焦转为图片
查看>>
POJ NOI0101-09 字符菱形
查看>>
jQuery--停止动画和判断是否处于动画状态stop()
查看>>
1-1 接口自动化测试框架从设计到开发
查看>>
MYSQL常用命令
查看>>
js 打开新页面 window.open()
查看>>
Intellij idea 一个窗口打开多模块并添加依赖
查看>>
生成自己的js工具包,包括打包webpack、测试mocha、生成文档jsdoc、发布npm包的操作...
查看>>
企业构建大数据分析体系的4个层级
查看>>
[Linux学习]man page常用按键
查看>>
Django中的CSRF
查看>>
iPhone 物理尺寸与分辨率
查看>>
ios9出现的问题
查看>>