久久狠狠色噜噜狠狠狠狠97|国产成人久久精品麻豆二区|精品精拍国产日韩26u|色偷偷亚洲第一综合网

始創(chuàng)于2000年 股票代碼:831685
咨詢(xún)熱線(xiàn):0371-60135900 注冊(cè)有禮 登錄
  • 掛牌上市企業(yè)
  • 60秒人工響應(yīng)
  • 99.99%連通率
  • 7*24h人工
  • 故障100倍補(bǔ)償
全部產(chǎn)品
您的位置: 網(wǎng)站首頁(yè) > 幫助中心>文章內(nèi)容

MySQL創(chuàng)建Function時(shí)報(bào)的1418錯(cuò)誤代號(hào)解決辦法

發(fā)布時(shí)間:  2012/9/20 17:13:15

以下是引用片段:
ErrorCode:1418
ThisfunctionhasnoneofDETERMINISTIC,NOSQL,orREADSSQLDATAinitsdeclarationandbinaryloggingisenabled(you*might*wanttousethelesssafelog_bin_trust_function_creatorsvariable)-
 

(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ò)語(yǔ)的時(shí)候:那么只需要執(zhí)行set global log_bin_trust_routine_creators=1;

然后怎么create function 都不會(huì)有問(wèn)題(當(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 ),
ERROR 1418 (HY000): 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) Assessment of the nature of a function is based on the “honesty” of the creator: MySQL does not check that a function declared DETERMINISTIC is free of statements that produce non-deterministic results.

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;
You can also set this variable by using the --log-bin-trust-function-creators=1 option when starting the server.
1. mysql> SET GLOBAL log_bin_trust_function_creators = 1;
2. 系統(tǒng)啟動(dòng)時(shí),加上--log-bin-trust-function-creators 參數(shù)為1
3. 直接在my.ini的[mysqld]區(qū)段加上log-bin-trust-function-creators=1
當(dāng)然我想大多數(shù)人會(huì)用第三種方法,
ok...繼續(xù)我的SP學(xué)習(xí),good luck..

二、mysql ERROR 1418 (HY000)

ERROR 1418 (HY000): 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īng)該是我們開(kāi)啟了bin-log, 我們就必須指定我們的函數(shù)是否是
1 DETERMINISTIC 不確定的
2 NO SQL 沒(méi)有SQl語(yǔ)句,當(dāng)然也不會(huì)修改數(shù)據(jù)
3 READS SQL DATA 只是讀取數(shù)據(jù),當(dāng)然也不會(huì)修改數(shù)據(jù)
4 MODIFIES SQL DATA 要修改數(shù)據(jù)
5 CONTAINS SQL 包含了SQL語(yǔ)句


其中在function里面,只有   DETERMINISTIC, NO SQL 和   READS SQL DATA 被支持。如果我們開(kāi)啟了 bin-log, 我們就必須為我們的function指定一個(gè)參數(shù)。

我們可以通過(guò)設(shè)置如下的參數(shù)來(lái)關(guān)掉這個(gè)。

SET GLOBAL log_bin_trust_function_creators = 1;

(you *might* want to use the less safe log_bin_trust_function_creators
variable)

 


本文出自:億恩科技【www.yaz797.com】

服務(wù)器租用/服務(wù)器托管中國(guó)五強(qiáng)!虛擬主機(jī)域名注冊(cè)頂級(jí)提供商!15年品質(zhì)保障!--億恩科技[ENKJ.COM]

  • 您可能在找
  • 億恩北京公司:
  • 經(jīng)營(yíng)性ICP/ISP證:京B2-20150015
  • 億恩鄭州公司:
  • 經(jīng)營(yíng)性ICP/ISP/IDC證:豫B1.B2-20060070
  • 億恩南昌公司:
  • 經(jīng)營(yíng)性ICP/ISP證:贛B2-20080012
  • 服務(wù)器/云主機(jī) 24小時(shí)售后服務(wù)電話(huà):0371-60135900
  • 虛擬主機(jī)/智能建站 24小時(shí)售后服務(wù)電話(huà):0371-60135900
  • 專(zhuān)注服務(wù)器托管17年
    掃掃關(guān)注-微信公眾號(hào)
    0371-60135900
    Copyright© 1999-2019 ENKJ All Rights Reserved 億恩科技 版權(quán)所有  地址:鄭州市高新區(qū)翠竹街1號(hào)總部企業(yè)基地億恩大廈  法律顧問(wèn):河南亞太人律師事務(wù)所郝建鋒、杜慧月律師   京公網(wǎng)安備41019702002023號(hào)
      0
     
     
     
     

    0371-60135900
    7*24小時(shí)客服服務(wù)熱線(xiàn)