Prompt when running MySQL: [Err] 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)
reason:
This is when we turn on bin-log, we must specify whether our function is
1 DETERMINISTIC uncertain
2 NO SQL has no SQl statement, and of course it will not modify the data
3 READS SQL DATA only reads the data, of course it will not modify the data
4 MODIFIES SQL DATA To modify the data
5 CONTAINS SQL contains SQL statements
Among them, in function, only DETERMINISTIC, NO SQL and READS SQL DATA are supported. If we enable bin-log, we must specify a parameter for our function.
Solution:
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
|
After adding the parameter in this way, if mysqld restarts, that parameter will disappear again, so remember to add in the my.cnf configuration file:
log_bin_trust_function_creators=1
Similar Posts:
- Mysql import Error Code: 2013 – Lost connection to MySQL server during query
- Loading local data is disabled; this must be enabled on both the client and server sides
- The ‘INFORMATION_SCHEMA.GLOBAL_STATUS’ feature is disabled; see the documentation for …
- [Solved] MYSQL Export Sheet Error: –secure-file-priv option so it cannot execute this statement
- MySQL Error: [Err] 1071 – Specified key was too long; max key length is 767 bytes
- How to Solve MySQL Secure file priv error
- MySQL external import data error [How to Solve]
- ERROR 2006 (HY000): MySQL server has gone away No
- [Solved] MYSQL Error 1040 (HY000): too many connections
- [Solved] MySQL Error: ERROR 1615 (HY000): Prepared statement needs to be re-prepared