现在的位置: 首页 > 综合 > 正文

Error Code: 1418的解决方案

2017年11月24日 ⁄ 综合 ⁄ 共 435字 ⁄ 字号 评论关闭

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数据库。
  优点:一劳永逸,解决问题。
  缺点:需要重启数据库,生产库上,如果业务不允许重启,那么你就只有选择第一种方案了。

抱歉!评论已关闭.