zoukankan      html  css  js  c++  java
  • Mysql无法创建函数 错误码: 1418

    在mysql中创建函数,报

    错误码: 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) 这个是创建函数功能未开。

    Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

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

    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)

    mysql> commit;
    Query OK, 0 rows affected (0.00 sec)

    mysql>

    然后在创建函数即可。

  • 相关阅读:
    npx小工具
    2015 Multi-University Training Contest 1
    字符串 --- KMP Eentend-Kmp 自动机 trie图 trie树 后缀树 后缀数组
    AC自动机
    AC自动机
    区间合并 --- Codeforces 558D : Gess Your Way Out ! II
    暴力 + 贪心 --- Codeforces 558C : Amr and Chemistry
    计数排序 + 线段树优化 --- Codeforces 558E : A Simple Task
    Ubuntu 16.04 安装mysql并设置远程访问
    数学 --- 高斯消元 POJ 1830
  • 原文地址:https://www.cnblogs.com/xd502djj/p/2696913.html
Copyright © 2011-2022 走看看