zoukankan      html  css  js  c++  java
  • mysql在创建存储函数时报错

    我们在使用mysql数据库开发项目的时候,有时Mysql系统自带的函数不能完全满足我们开发的需要,解决方法是自己创建函数,可以有可能在你创建函数的过程事会报出Error 1418错误,对于报这种错误的详细信息如所所示

    出错信息大致类似:

    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)

    解决方法:MySQL函数不能创建,是未开启功能:

    mysql> show variables like '%func%';
    +---------------------------------+-------+
    | Variable_name | Value |
    +---------------------------------+-------+
    | log_bin_trust_function_creators | OFF |
    +---------------------------------+-------+
    1 row in set (0.00 sec)

    mysql> set global log_bin_trust_function_creators=1;
    Query OK, 0 rows affected (0.00 sec)

    mysql> show variables like '%func%';
    +---------------------------------+-------+
    | Variable_name | Value |
    +---------------------------------+-------+
    | log_bin_trust_function_creators | ON |
    +---------------------------------+-------+
    1 row in set (0.00 sec)mysql>

    如果上方法不能成功解决mysql中的ERROR 1418错误,那还得请你使用下面方法试试:

      1方式: mysql> SET GLOBAL log_bin_trust_function_creators = 1;

      2方式: 系统启动时 --log-bin-trust-function-creators=1

      3方式: 在my.ini(Linux下为my.conf)文件中 [mysqld] 标记后加一行内容为 log-bin-trust-function-creators=1

  • 相关阅读:
    .NET:如何应对边界异常?
    由极点五笔到QQ五笔的转换想到的
    【转】七个受用一生的心理寓言
    proverb: better late than never
    背单词软件supermemo从2006版升级到2008版
    今天解决一个异步刷新TreeView的问题
    开始尝试换成Windows 7了
    southpaw
    用supermemo背单词达到6000词条
    Averse, Adverse
  • 原文地址:https://www.cnblogs.com/siqi/p/2665377.html
Copyright © 2011-2022 走看看