MySQL functions cannot be created.
MySQL functions cannot be created, which is a very troublesome problem. The following provides you with a solution to this problem. If you have encountered similar problems, take a look.
Http://database.51cto.com/art/201010/229918.htm
When using a MySQL database, you may encounter situations where MySQL functions cannot be created. The following describes how to solve the problem that MySQL functions cannot be created.
The error information is similar to the following:
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)
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)
MySQL functions cannot be created, but functions are not enabled:
- Mysql> show variables like '% func % ';
- + --------------------------------- + ------- +
- | Variable_name | Value |
- + --------------------------------- + ------- +
- | Log_bin_trust_function_creators | OFF |
- + --------------------------------- + ------- +
- 1 row in set (0.00 sec)
-
- Mysql> set global log_bin_trust_function_creators = 1;
- Query OK, 0 rows affected (0.00 sec)
-
- Mysql> show variables like '% func % ';
- + --------------------------------- + ------- +
- | Variable_name | Value |
- + --------------------------------- + ------- +
- | Log_bin_trust_function_creators | ON |
- + --------------------------------- + ------- +
- 1 row in set (0.00 sec) mysql>
============================
Http://blog.csdn.net/ciwei007/article/details/15635151
1. The error message for creating a UDF in MySQL is as follows:
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)
Solution:
Mysql> set global log_bin_trust_function_creators = 1;
Source Document
2. When creating a function
Error message:
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)
Cause:
If bin-log is enabled, you must specify whether our function is
1 DETERMINISTIC
2 no SQL does not have SQL statements, and of course data will not be modified
3 reads SQL DATA only READS DATA, and certainly does not modify the DATA
4 modifies SQL DATA to modify DATA
5 contains SQL statements
In function, only DETERMINISTIC, no SQL, and reads SQL DATA are supported. If bin-log is enabled, we must specify a parameter for our function.
Solution to this error when creating a function in MySQL:
Set global log_bin_trust_function_creators = TRUE;
Source Document
3,
An error occurred while importing data to MySQL.
Error message:
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)
Cause:
If bin-log is enabled, you must specify whether our function is
1 DETERMINISTIC
2 no SQL does not have SQL statements, and of course data will not be modified
3 reads SQL DATA only READS DATA, and certainly does not modify the DATA
4 modifies SQL DATA to modify DATA
5 contains SQL statements
In function, only DETERMINISTIC, no SQL, and reads SQL DATA are supported. If bin-log is enabled, we must specify a parameter for our function.
Solution:
SQL code
Mysql> show variables like '% func % ';
+ --------------------------------- + ------- +
| Variable_name | Value |
+ --------------------------------- + ------- +
| Log_bin_trust_function_creators | OFF |
+ --------------------------------- + ------- +
1 row in set (0.00 sec)
Mysql> set global log_bin_trust_function_creators = 1;
Query OK, 0 rows affected (0.00 sec)
Mysql> show variables like '% func % ';
+ --------------------------------- + ------- +
| Variable_name | Value |
+ --------------------------------- + ------- +
| Log_bin_trust_function_creators | ON |
+ --------------------------------- + ------- +
1 row in set (0.00 sec)
Source Document
4,
I want to write a function today. But there is no way to create a prompt: the error is as follows:
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)
Solution: (edit my. cnf and add as follows)
[Mysqld]
Log_bin_trust_routine_creators = 1
Restart mysql.
Humen1 Tech
Source Document