MYsql 出现This function has none of DETERMINISTIC, NO SQL解决办法
大苹果

MYsql 出现This function has none of DETERMINISTIC, NO SQL解决办法

完整错误描述:ThisfunctionhasnoneofDETERMINISTIC,NOSQL解决办法创建存储过程时出错信息:ERROR1418(HY000):ThisfunctionhasnoneofDETERMINISTIC,NOSQL,orREADSSQLDATAinitsdeclarationandbinaryloggingisenabled(you*might*wanttousethelesssafelog_bin_trust_function_creatorsvariable)原因:这是我们开启了bin-log,我们就必须指定我们的函数是否是1DETERMINISTIC不确定的2NOSQL没有SQl语句,当然也不会修改数据3READSSQLDATA只是读取数据,当然也不会修改数据4MODIFIESSQLDATA要修改数据5CONTAINSSQL包含了SQL语句其中在function里面,只有DETERMINISTIC,NOSQL和READSSQLDATA被支持。如果我们开启了bin-log,我们就必须为我们的function指定一个参数。解决方法:SQLcodemysql>showvariableslike'log_bin_trust_function_creators';+---------------------------------+-------+|Variable_name|Value|+---------------------------------+-------+|log_bin_trust_function_creators|OFF|+---------------------------------+-------+mysql>setgloballog_bin_trust_function_creators=1;mysql>showvariableslike'log_bin_trust_function_creators';+---------------------------------+-------+|Variable_name|Value|+---------------------------------+-------+|log_bin_trust_function_creators|ON|+---------------------------------+-------+这样添加了参数以后,如果mysqld重启,那个参数又会消失,因此记得在my.cnf配置文件中添加:log_bin_trust_function_creators=1

mysql,DETERMINISTIC,ERR 5638 7年前
共 1 页