MYSQL 中有存储过程或者函数的数据导入失败

下面直接上报错内容:

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)
时间: 0.001s

应为开启了:bin-log日志功能
执行下面内容,查看状态。
并使 log_bin_trust_function_creators 为 ON 的状态

SQL code
mysql> show variables like 'log_bin_trust_function_creators';
+---------------------------------+-------+
| Variable_name          | Value |
+---------------------------------+-------+
| log_bin_trust_function_creators | OFF  |
+---------------------------------+-------+
mysql> set global log_bin_trust_function_creators=1;
mysql> show variables like 'log_bin_trust_function_creators';
+---------------------------------+-------+
| Variable_name          | Value |
+---------------------------------+-------+
| log_bin_trust_function_creators | ON  |

这样添加了参数以后,如果mysqld重启,那个参数又会消失,因此记得在my.cnf配置文件中添加:

log_bin_trust_function_creators=1


版权声明:本文为sinat_39512352原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。