mysql8.0错误代码:1418This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declarati

1 queries executed, 0 success, 1 errors, 0 warnings

查询:CREATE FUNCTION test() RETURNS INT BEGIN DECLARE v_num INT default 0; SELECT COUNT(*) INTO v_num FROM admin; RETURN v_num; END

错误代码: 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中执行如下代码:

set global log_bin_trust_function_creators=TRUE;

猜你喜欢

转载自blog.csdn.net/crraxx/article/details/122589457