在將sql導入到mysql時候出現以下錯誤:
ERROR 1418 (HY000) at line 8752: 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官方文檔:
http://dev.mysql.com/doc/refman/5.0/en/stored-programs-logging.html
必須設置 www.111cn.net
代碼如下 復制代碼global log_bin_trust_function_creatorssystem variable to 1.
mysql> SET GLOBAL log_bin_trust_function_creators = 1;
在my.ini(linux下為my.conf)文件中 [mysqld] 標記後加一行內容為 log-bin-trust-function-creators
如果在create function的時候有 1418的錯語的時候:那麼只需要執行set gl在創建子程序(存儲過程、函數、觸發器)時,聲明為DETERMINISTIC或NO SQL與READS SQL DATA中的一個,
例如:
代碼如下 復制代碼CREATE DEFINER = CURRENT_USER PROCEDURE `NewProc`()
DETERMINISTIC
BEGIN
#Routine body goes here...
END;
obal log_bin_trust_routine_creators=1;