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

     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. 根据错误提示做下列查询

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

4. 设定开启状态

         SET GLOBAL log_bin_trust_function_creators = 1;

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

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

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

 [[email protected] ~]# systemctl restart mysql;

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

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

执行存储过程创建,ok

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

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

相关文章:

相似解决方案