這篇文章主要介紹了MySQL數(shù)據(jù)庫開啟、關(guān)閉、查看函數(shù)功能的方法,本文為解決一個(gè)錯誤總結(jié)而來,錯誤信息本文一同給出,需要的朋友可以參考下
應(yīng)用 MySQL 時(shí),會遇到不能創(chuàng)建函數(shù)的情況。出現(xiàn)如下錯誤信息:
復(fù)制代碼代碼如下:
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ù)功能:
復(fù)制代碼代碼如下:
SET GLOBAL log_bin_trust_function_creators=1;
關(guān)閉MySQL函數(shù)功能:
復(fù)制代碼代碼如下:
SET GLOBAL log_bin_trust_function_creators=0;
查看狀態(tài):
復(fù)制代碼代碼如下:
show variables like '%func%';