mysql ERROR 1418 (HY000): This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in i...

在mysql中创建自定义函数时出现的错误

ERROR 1418 (HY000): 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的设置默认是 不允许创建自定义函数的,这是出于安全性的考虑,所以只要设置信息用户的操作就可以了

解决办法

mysql> set global log_bin_trust_function_creators=TRUE;
Query OK, 0 rows affected (0.00 sec)

测试创建自定义函数

你可能感兴趣的:(mysql ERROR 1418 (HY000): This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in i...)