MySQL函數(shù)不能創(chuàng)建的解決方法
在使用MySQL數(shù)據(jù)庫時,有時會遇到MySQL函數(shù)不能創(chuàng)建的情況。下面就教您一個解決MySQL函數(shù)不能創(chuàng)建問題的方法,供您借鑒參考。
出錯信息大致類似:
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)
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函數(shù)不能創(chuàng)建,是未開啟功能:
- 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>
【編輯推薦】