mysql导入sql到mysql提示ERROR 1418错误

今天把从A数据库导出的sql文件导入的B数据时,报出1418的错误,具体是在创建一个函数时产生的错误信息如下:

错误代码: 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)

(1)经过上网查询分析,说是mysql中的这个参数log_bin_trust_function_creators的值为OFF,所以不能创建函数,通过排查果然是A库的这个参数值是ON,B库的这个参数值是OFF

(2)用root用户登录B库,执行命令set global log_bin_trust_function_creators=1;再通过SHOW VARIABLES LIKE 'log_bin_trust_function_creators'; 查看结果为ON

(3)再次执行创建函数的语句,成功

 

posted on 2018-09-19 14:32  geidianmianzi  阅读(694)  评论(0编辑  收藏  举报

导航