错误:
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)
原因:
解决办法:
将主库执行:
SHOW VARIABLES LIKE '%func%';
SET GLOBAL log_bin_trust_function_creators = 1 ;
先查看开启状态,应为OFF。开启后,再进行查询:
SET GLOBAL log_bin_trust_function_creators = 1 ;
应为ON。
在从库,应该先将主从复制关闭。
SHOW SLAVE STATUS \G;
STOP SLAVE;
SET GLOBAL log_bin_trust_function_creators = 1 ;
START SLAVE;