標籤:
1.This function has none of DETERMINISTIC, NO SQL
原因:
Mysql如果開啟了bin-log, 我們就必須指定我們的函數是否是
1 DETERMINISTIC 不確定的
2 NO SQL 沒有SQl語句,當然也不會修改資料
3 READS SQL DATA 只是讀取資料,當然也不會修改資料
4 MODIFIES SQL DATA 要修改資料
5 CONTAINS SQL 包含了SQL語句
解決方案:
mysql> show variables like ‘log_bin_trust_function_creators‘;+---------------------------------+-------+| Variable_name | Value |+---------------------------------+-------+| log_bin_trust_function_creators | OFF |+---------------------------------+-------+mysql> set global log_bin_trust_function_creators=1;mysql> show variables like ‘log_bin_trust_function_creators‘;+---------------------------------+-------+| Variable_name | Value |+---------------------------------+-------+| log_bin_trust_function_creators | ON |+---------------------------------+-------+
最好是直接加在my.cnf(windows是my.ini)裡作為啟動參數 log_bin_trust_function_creators=1
出處:http://blog.chinaunix.net/uid-20639775-id-3031821.html
MySQL問題匯總(持續更新)