Home > Database > Mysql Tutorial > Solve the problem of mysql error This function has none of DETERMINISTIC

Solve the problem of mysql error This function has none of DETERMINISTIC

藏色散人
Release: 2021-06-04 11:49:03
forward
4291 people have browsed it

This article will introduce to you the solution to mysql error This function has none of DETERMINISTIC. It has certain reference value. Friends in need can refer to it. I hope it will be helpful to everyone.

This article introduces to friends how to open the bin-log log mysql error: This function has none of DETERMINISTIC, NO SQL solution,

When creating a stored procedure

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)
Copy after login

Cause:

This is because we have opened the bin-log, we must specify whether our function is

1 DETERMINISTIC 不确定的
2 NO SQL 没有SQl语句,当然也不会修改数据
3 READS SQL DATA 只是读取数据,当然也不会修改数据
4 MODIFIES SQL DATA 要修改数据
5 CONTAINS SQL 包含了SQL语句
Copy after login

In the function, there is 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  |
Copy after login

After adding the parameter in this way, if mysqld restarts, the parameter will disappear again, so remember to add:

log_bin_trust_function_creators=1
Copy after login

in the my.cnf configuration file Recommended: "mysql video tutorial"

The above is the detailed content of Solve the problem of mysql error This function has none of DETERMINISTIC. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:jb51.net
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template