Home > Database > Mysql Tutorial > body text

mysql 1418无法创建函数的解决方法_MySQL

WBOY
Release: 2016-06-01 13:38:32
Original
973 people have browsed it

bitsCN.com


mysql 1418无法创建函数的解决方法

 

ErrorCode:1418 

ThisfunctionhasnoneofDETERMINISTIC,NOSQL,orREADSSQLDATAinitsdeclarationandbinaryloggingisenabled(you*might*wanttousethelesssafelog_bin_trust_function_creatorsvariable)

(0mstaken) 

  解决方法如下: 

 

  1. mysql> SET GLOBAL log_bin_trust_function_creators = 1; 

 

  2. 系统启动时 --log-bin-trust-function-creators=1 

 

  3. 在my.ini(linux下为my.conf)文件中 [mysqld] 标记后加一行内容为 log-bin-trust-function-
creators 

 

如果在create function的时候有 1418的错语的时候:那么只需要执行set global log_bin_
trust_routine_creators=1; 

 

然后怎么create function 都不会有问题(当然,你的function必段正确哦),这是mysql的一个bug,
搞不懂为什么,反正这样做就OK了. 

 

另外,也可以直接在配置文件my.cnf中添加如下行[mysqld] log_bin_trust_routine_creators=1; 

 

这个命令可以在sql editor的环境中运行,并不需要重新启动服务哦。
 

bitsCN.com
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!