(2013-02-22 15:17:37)html
轉載▼less
標籤: [err]1418函數建立報錯 |
分類: 菜鳥DBA之MySQL |
-----------------------------------------------------------------------------------------------函數
本文爲我的筆記,僅供參考,但願對您的疑問有所幫助。歡迎轉載,轉載請註明出處。謝謝!url
-----------------------------------------------------------------------------------------------spa
錯誤信息:htm
[Err] 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)blog
緣由:get
這是咱們開啓了bin-log, 咱們就必須指定咱們的函數是不是it
1 DETERMINISTIC 不肯定的io
2 NO SQL 沒有SQl語句
3 READS SQL DATA 只是讀取數據
4 MODIFIES SQL DATA 要修改數據
5 CONTAINS SQL 包含SQL語句
其中在function裏面,只有 DETERMINISTIC, NO SQL 和 READS SQL DATA 被支持。若是咱們開啓了 bin-log, 咱們就必須爲咱們的function指定一個參數。
在MySQL中建立函數時出現這種錯誤的解決方法:
set global log_bin_trust_function_creators=TRUE;
or
set global log_bin_trust_function_creators=1;