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)

Insert image description here
Solution:
Execute the following code in MySQL:

set global log_bin_trust_function_creators=TRUE;

Guess you like

Origin blog.csdn.net/crraxx/article/details/122589457