在默认下创建function的时候,会报如下错误
Error Code: 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)
解决方法,打开这个变量的值就行了,mysql8.0新特性中有个persist关键字,可以支持化设置变量,这样断开连接后,下次再进来,上次设置的的变量会永久保存,
show variables like '%log_bin_trust_function_creators%'
set persist log_bin_trust_function_creators = 1