MySQL you *might* want to use the less safe log_bin_trust_function_creators variable

转自:https://www.cnblogs.com/northeastTycoon/p/5526722.html

因为在打开日志文件情况【即记录binlog的情况下】下执行以前建立的 自定义函数报错详细分析如下:

     1 .调用自定义函数

     mysql>  select sp_function_dbdh_three();  #以前自定义的函数

    2. 报错信息:
     ERROR 1418 (HY000): This function has none of DETERMINISTIC, NO SQL, or READS SQ
    L DATA in its declaration and binary logging is enabled (you *might* want to use
    the less safe log_bin_trust_function_creators variable)

    3. 根据错误提示做下列查询

    

   4. 设定开启状态

         SET GLOBAL log_bin_trust_function_creators = 1;

   5. 数据库服务重启后发现调用报错,根据经验需要设定环境全局变量设定方法如下

        (1) 在初始化参数的 [mysqld] 节加上:log_bin_trust_function_creators=1如下所示

             

        (2) 做相关函数查询如下:说明参数启作用.

          

 通过以上实例说明在启动日志操作后对函数的操作需要设定参数值否则无法使用.

发布了98 篇原创文章 · 获赞 39 · 访问量 21万+

猜你喜欢

转载自blog.csdn.net/XiaoXiao_RenHe/article/details/102561168
今日推荐