首页 > 技术文章 > 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

wamptao 2017-03-16 15:30 原文

1、导入sql文件出现如下错误。

[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)
[Err] SET FOREIGN_KEY_CHECKS=0;

解决方案:

log_bin_trust_routine_creators全局系统变量为1。设置方法有三种:
  1.在客户端上执行SET GLOBAL log_bin_trust_function_creators = 1;
  2.MySQL启动时,加上--log-bin-trust-function-creators选贤,参数设置为1
  3.在MySQL配置文件my.ini或my.cnf中的[mysqld]段上加log-bin-trust-function-creators=1

 

推荐阅读