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)
1,set global log_bin_trust_function_creators=TRUE;
优点:不用重启数据库,就解决问题了,直接可以使用function了。
缺点:一重启数据库,就又要执行一次,否则下次function你就用不了。
2,在/etc/my.cnf的【mysqld】后面 添加 log_bin_trust_function_creators=true,然后重启mysql数据库。
优点:一劳永逸,解决问题。
缺点:需要重启数据库,生产库上,如果业务不允许重启,那么你就只有选择第一种方案了。
本文介绍了如何解决在MySQL中创建函数时遇到的ErrorCode:1418错误。提供了两种解决方案:一是通过设置log_bin_trust_function_creators变量为TRUE临时解决问题;二是修改配置文件并重启数据库实现永久修复。
5696

被折叠的 条评论
为什么被折叠?



