创建mysql函数出现错误: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)
出现原因:
mysql开启了bin-log, 就必须指定函数是否是
1 DETERMINISTIC 不确定的
2 NO SQL 没有SQl语句
3 READS SQL DATA 只是读取数据
4 MODIFIES SQL DATA 要修改数据
5 CONTAINS SQL 包含SQL语句
解决方法:
在MySQL中创建函数时出现这种错误的解决方法:
1. 在mysql数据库中执行以下语句 (临时生效,重启后失效)
set global log_bin_trust_function_creators=TRUE;
or
set global log_bin_trust_function_creators=1;
2. 在配置文件/etc/my.cnf的[mysqld]配置log_bin_trust_function_creators=1
—————————— 本文为个人笔记,仅供参考 ——————————