在创建函数时,往往会遇到创建函数失败的情形,除去书写的创建函数的sql语句本身语法错误之外,还会碰到一个错误就是,

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)

当提示这种错误的时候,解决方法如下:

一、查看创建函数的功能是否开启:

mysql> show variables like '%func%';

 

二、如果Value处值为OFF,则需将其开启。
mysql> set global log_bin_trust_function_creators=1;

 

每天学习一点点,你就进步一点点。