在使用MySql自己定义的函数时,出现错误java.sql.SQLException: 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客户端,执行: SET GLOBAL log_bin_trust_function_creators = 1;
2.在登录MySQL服务器是,在服务启动时加上 “--log-bin-trust-function-creators=1 ”参数并设置为1。
3.在my.ini(my.cnf)中的[mysqld]区段中加上 log-bin-trust-function-creators=1。
方法1是临时,只有2和3只需要修改一次即可;