mysql创建函数报This function has none of DETERMINISTIC

mysql创建函数时报错:This function has none of DETERMNISTIC, NO SOL, or READS SOL DATA in its declaration and binary logging is enabled (you might want to use the less safe log bin trust function creators variable)

解决办法:

第一步:执行 show variables like ‘log_bin_trust_function_creators’;

得到

mysql创建函数报This function has none of DETERMINISTIC_第1张图片
value 是OFF就是错误产生的原因

第二步:执行 set global log_bin_trust_function_creators=1;

得到

在这里插入图片描述

第三步:执行 show variables like ‘log_bin_trust_function_creators’;

得到

mysql创建函数报This function has none of DETERMINISTIC_第2张图片
Value 值为ON

问题解决

就可以保存函数了

你可能感兴趣的:(mysql,数据库)