mysql建立自定義函數(shù)的問(wèn)題

由于這幾天在寫mysql存儲(chǔ)過(guò)程且發(fā)現(xiàn)程序體積越來(lái)越龐大,于是嘗試使用mysql的函數(shù)

創(chuàng)建函數(shù)時(shí)問(wèn)題馬上出現(xiàn):

ERROR 1418 (HY000): This routine 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_routine_creators
variable)
在mysql在線文檔中找到解決方案,網(wǎng)址為:
http://dev.mysql.com/doc/refman/5.1/zh/stored-procedures.html#create-procedure
只需要將log_bin_trust_routine_creators 設(shè)置為 1 即可,解決方法

在my.ini的[mysqld]下加上log-bin-trust-function-creators=1
希望各位在使用過(guò)程中碰到問(wèn)題少走彎路。

? 版權(quán)聲明
THE END
喜歡就支持一下吧
點(diǎn)贊7 分享
站長(zhǎng)的頭像-小浪學(xué)習(xí)網(wǎng)月度會(huì)員