Because the previous custom function was executed in the case of opening the log file, a detailed analysis of the error is as follows:
1. Calling a custom function
Mysql> select Sp_function_dbdh_three (); #以前自定义的函数
2. Error message:
ERROR 1418 (HY000): This function has none of deterministic, NO SQL, or READS SQ
L DATA in its declaration and binary logging are enabled (you *might* want
The less safe log_bin_trust_function_creators variable)
3. Make the following query based on the error message
4. Set the Open state
SET GLOBAL log_bin_trust_function_creators = 1;
5. After the database service restarts, the call error is found, according to the experience needs to set the environment global variable setting method as follows
(1) in the initialization parameter of the [mysqld] section plus: Log_bin_trust_function_creators=1 as shown below
(2) Make the relevant function query as follows: Explain the function of the parameter.
The above example shows that the operation of the function after initiating the log operation needs to set the parameter value otherwise it cannot be used.
MySQL *might* want to use the less safe log_bin_trust_function_creators variable