應(yīng)用 MySQL 時(shí),會(huì)遇到不能創(chuàng)建函數(shù)的情況。出現(xiàn)如下錯(cuò)誤信息:
代碼如下:
ERROR 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)
那是因?yàn)闆]有將功能開啟。
開啟MySQL函數(shù)功能:
代碼如下:
SET GLOBAL log_bin_trust_function_creators=1;
關(guān)閉MySQL函數(shù)功能:
代碼如下:
SET GLOBAL log_bin_trust_function_creators=0;
查看狀態(tài):
代碼如下:
show variables like '%func%';
更多信息請(qǐng)查看IT技術(shù)專欄