项目场景:
创建不了函数
CREATE DEFINER=`root`@`localhost` FUNCTION `qwe`() RETURNS varchar(50) CHARSET utf8mb3 COLLATE utf8_bin
BEGIN
declare sname varchar(20);
declare age INT;
set sname="xiaohong";
set age=123;
RETURN CONCAT(sname,"今年",age,"岁");
END
问题描述
保存函数,此时,弹出
在navicat上点函数保存不了
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)
原因分析:
我是网上找到了这个帖子
csdn的一个帖子
解决方案:
运行一下这串:
set global log_bin_trust_function_creators=1;
我发现就可以保存函数了