MySQL 創建函數失敗提示1418
在創建函數時,往往會遇到創建函數失敗的情形,除去書寫的創建函數的sql語句本身語法錯誤之外,還會碰到一個錯誤就是,
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)
當提示這種錯誤的時候,解決方法如下:
一、查看創建函數的功能是否開啟:
mysql> show variables like '%func%';
+-----------------------------------------+-------+
| Variable_name | Value |
+-----------------------------------------+-------+
| log_bin_trust_function_creators | ON |
+-----------------------------------------+-------+
1 row in set (0.02 sec)
二、如果Value處值為OFF,則需將其開啟。
mysql> set global log_bin_trust_function_creators=1;
三、創建函數
語法略過,可以通過Navicat工具操作,簡單快捷
