MySQL創(chuàng)建Function時(shí)報(bào)的1418錯(cuò)誤代號(hào)解決辦法 |
發(fā)布時(shí)間: 2012/9/20 17:13:15 |
以下是引用片段: (0mstaken) 解決方法如下: 1. mysql> SET GLOBAL log_bin_trust_function_creators = 1; 2. 系統(tǒng)啟動(dòng)時(shí) --log-bin-trust-function-creators=1 3. 在my.ini(linux下為my.conf)文件中 [mysqld] 標(biāo)記后加一行內(nèi)容為 log-bin-trust-function-creators 如果在create function的時(shí)候有 1418的錯(cuò)語的時(shí)候:那么只需要執(zhí)行set global log_bin_trust_routine_creators=1; 然后怎么create function 都不會(huì)有問題(當(dāng)然,你的function必段正確哦),這是mysql的一個(gè)bug,搞不懂為什么,反正這樣做就OK了. 另外,也可以直接在配置文件my.cnf中添加如下行[mysqld] log_bin_trust_routine_creators=1; 這個(gè)命令可以在sql editor的環(huán)境中運(yùn)行,并不需要重新啟動(dòng)服務(wù)哦。 MySQL自5.0之後終於支援SP( Store Procedures ), To relax the preceding conditions on function creation (that you must have the SUPER privilege and that a function must be declared deterministic or to not modify data), set the global log_bin_trust_function_creators system variable to 1. By default, this variable has a value of 0, but you can change it like this: mysql> SET GLOBAL log_bin_trust_function_creators = 1; 二、mysql ERROR 1418 (HY000) ERROR 1418 (HY000): This function has none of DETERMINISTIC, NO SQL, 應(yīng)該是我們開啟了bin-log, 我們就必須指定我們的函數(shù)是否是
我們可以通過設(shè)置如下的參數(shù)來關(guān)掉這個(gè)。 SET GLOBAL log_bin_trust_function_creators = 1; (you *might* want to use the less safe log_bin_trust_function_creators
本文出自:億恩科技【mszdt.com】 服務(wù)器租用/服務(wù)器托管中國五強(qiáng)!虛擬主機(jī)域名注冊頂級(jí)提供商!15年品質(zhì)保障!--億恩科技[ENKJ.COM] |