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

在恢复mysql数据库时提示

1418 - 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   'log_bin_trust_function_creators';
+ -- -------------------------------+-------+
|   Variable_name                     |   Value   |
+ -- -------------------------------+-------+
|   log_bin_trust_function_creators   |   OFF     |
+ -- -------------------------------+-------+
mysql >   set   global log_bin_trust_function_creators = 1 ;
mysql >   show variables   like   ' log_bin_trust_function_creators ' ;
+ -- -------------------------------+-------+
|   Variable_name                     |   Value   |
+ -- -------------------------------+-------+
|   log_bin_trust_function_creators   |   ON      |
+ -- -------------------------------+-------+
 
这样添加了参数以后,如果mysqld重启,那个参数又会消失,因此记得在my.cnf配置文件中添加:
log_bin_trust_function_creators=1

你可能感兴趣的:(function)