加入收藏 | 设为首页 | 会员中心 | 我要投稿 濮阳站长网 (https://www.0393zz.cn/)- 专属主机、数据湖、操作系统、媒体智能、数据分析!
当前位置: 首页 > 站长学院 > MySql教程 > 正文

MySQL创建函数出现1418错误解决办法总结

发布时间:2022-06-18 08:45:11 所属栏目:MySql教程 来源:互联网
导读:本文章来给大家介绍关于MySQL创建函数出现1418错误解决方法,出现这种问题我们只要简单的一句就可以解决了. 错误码:1418 This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled (you *might
  本文章来给大家介绍关于MySQL创建函数出现1418错误解决方法,出现这种问题我们只要简单的一句就可以解决了.
 
  错误码: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) 这个是创建函数功能未开。
  (you *might* want to use the less safe log_bin_trust_function_creators variable)  
  (0 ms taken)
  分析:根据系统提示,导致该错误的原因可能是一个安全设置方面的配置,查手册.
 
  log_bin_trust_function_creators参数缺省0,是不允许function的同步的,一般我们在配置repliaction的时候,都忘记关注这个参数,这样在master更新funtion后,slave就会报告错误,然后slave stoped.
 
  处理过程:登陆mysql数据库.
 
  > set global log_bin_trust_function_creators = 1;
  > start slave;
  mysql> set og_bin_trust_function_creators =1;
  ERROR 1193 (HY000): Unknown system variable 'og_bin_trust_function_creators'
  mysql> set log_bin_trust_function_creators =1;
  ERROR 1229 (HY000): Variable 'log_bin_trust_function_creators' is a GLOBAL variable and should be set with SET GLOBAL
  mysql> set global log_bin_trust_function_creators =1;
  Query OK, 0 rows affected (0.00 sec)
  mysql> show variable like '%func%';
  ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'variable like '%func%'' at line 1
  mysql> show variables like '%func%';
  +---------------------------------+-------+
  | Variable_name                   | Value |
  +---------------------------------+-------+
  | log_bin_trust_function_creators | ON    |
  +---------------------------------+-------+
  1 row in set (0.01 sec)  --phpfensi.com
  mysql> commit;
  Query OK, 0 rows affected (0.00 sec)
  mysql>
  跟踪mysql的启动日志,slave正常运行,问题解决.

(编辑:濮阳站长网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读