mysql create function error and solution way.

Error Code: 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 :

  mysql的设置默认是不允许创建函数

解决办法1:

执行:

SET GLOBAL log_bin_trust_function_creators = 1;

解决办法2:

在my.cnf里面设置

log-bin-trust-function-creators=1

时间: 2024-10-09 18:01:57

mysql create function error and solution way.的相关文章

sql:MySql create FUNCTION,VIEW,PROCEDURE

use geovindu; #函数 DELIMITER $$ drop function if exists f_GetDepartmentName $$ CREATE function f_GetDepartmentName ( did int ) returns nvarchar(400) begin declare str nvarchar(100); select DepartmentName into str from DepartmentList where DepartmentID

MySQL 自定义函数CREATE FUNCTION实例

分享一个MySQL 自定义函数CREATE FUNCTION的实例.mysql> delimiter $$mysql> CREATE FUNCTION myFunction-> (in_string VARCHAR(255),-> in_find_str VARCHAR(20),-> in_repl_str VARCHAR(20))->-> RETURNS VARCHAR(255)-> BEGIN-> DECLARE l_new_string VARC

Mysql错误问题:ERROR 1005 (HY000): Can't create table 'crm_1.tbl_client' (errno: 150)

MySQL外键创建条件: 1.两个表必须是InnoDB数据引擎2.外键表的外键字段必须是主键3.字段类型必须一致 创建表时创建外键: create table tbl_client(userName varchar(255) not null, address varchar(255), createDate timestamp not null default now(), createUserName varchar(255), foreign key(createUserName) ref

Adding New Functions to MySQL(User-Defined Function Interface UDF、Native Function)

catalog 1. How to Add New Functions to MySQL 2. Features of the User-Defined Function Interface 3. User-Defined Function 4. UDF Argument Processing 5. UDF Return Values and Error Handling 6. UDF Compiling and Installing 7. Adding a New Native Functio

mysql: symbol lookup error: /usr/local/lib/libreadline.so.6: undefined symbol: UP

Error Symptom: when you run $mysql -u root -p command in the linux you get an error message ” mysql: symbol lookup error: /usr/local/lib/libreadline.so.6: undefined symbol: UP” Solution: Step 1: Login as root Step 2: Go to folder path #cd/usr/local/l

Create function through MySQLdb

http://stackoverflow.com/questions/745538/create-function-through-mysqldb How can I define a multi-statement function or procedure in using the MySQLdb lib in python? Example: import MySQLdb db = MySQLdb.connect(db='service') c = db.cursor() c.execut

MySQL This function has none of DETERMINISTIC, NO SQL...错误1418 的原因分析及解决方法

MySQL开启bin-log后,调用存储过程或者函数以及触发器时,会出现错误号为1418的错误: 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_creat

【MySQL案例】ERROR 1418

1.1.1. ERROR 1418 [环境描述] mysql5.0.67 [问题描述] 创建存储过程的时候遇到ERROR 1418报错. # 创建函数的SQL语句 CREATE FUNCTION `xxx`( num01 int ) RETURNSint(11) begin declare mm  int default 0; if  (xx) then set mm = num01*num01*10; elseif  xxx then set mm = 10; else case num01

Mysql create constraint foreign key faild.trouble shooting method share

mysql> create table tb_test (id int(10) not null auto_increment primary key,action_id int(10) not null,error_code int(10) not null default 0,desc_key varchar(64) not null default 'audit.log.default',INDEX(action_id),constraint `FK_ACTIONID` foreign k