创建function时 出错信息: 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)
原因: 这是我们开启了bin-log, 我们就必须指定我们的函数是否是 解决方法: SQL code mysql>show variables like '%func%'; +---------------------------------+-------+ |Variable_name |Value| +---------------------------------+-------+ |log_bin_trust_function_creators|OFF | +---------------------------------+-------+ 1 row in set (0.00sec) mysql>set global log_bin_trust_function_creators=1; Query OK,0 rows affected (0.00sec) mysql>show variables like '%func%'; +---------------------------------+-------+ |Variable_name |Value| +---------------------------------+-------+ |log_bin_trust_function_creators|ON | +---------------------------------+-------+ 1 row in set (0.00sec) mysql>
|
或者
这样添加了参数以后,如果mysqld重启,那个参数又会消失,因此记得在my.cnf配置文件中添加:
log_bin_trust_function_creators=1