下面是我创建函数的代码:
delimiter $$
drop function if exists rand_num $$
create function rand_num( )
returns int(5)
begin
declare i int default 0;
set i = floor(10+rand()*500);
return i;
end $$
delimiter ;然后在命令行模式下执行的时候mysql报错,然后错误如下:
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)请问这个是怎么回事啊??怎么解决??
delimiter $$
drop function if exists rand_num $$
create function rand_num( )
returns int(5)
begin
declare i int default 0;
set i = floor(10+rand()*500);
return i;
end $$
delimiter ;然后在命令行模式下执行的时候mysql报错,然后错误如下:
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)请问这个是怎么回事啊??怎么解决??
解决方案 »
- 好像很难,这个sql到底该怎么写,彻底求助!!!!!!!
- select语句加了索引条件过滤,执行效率反而比全表扫描更慢,这是怎么回事?
- SQL语句(急)
- 求一个sql语句的写法....急急急
- 怎样找出某数据库的所有用户名和密码
- 请教怎么得到当前记录行号?
- mysql 用 select 時出 Error 1030: go error 127 from table handler 怎麼解決? 謝謝!!!
- now()获取系统时间差8小时
- mysql default 无效问题
- Mysql:ERROR 2003 (HY000) 110错误 防火墙关闭,telnet对应端口也能通
- 删除数据时提示#1030 - Got error -1 from storage engine
- mysql的问题
set global log_bin_trust_function_creators =1;
就解决了。
drop function if exists rand_num $$
create function rand_num( )
returns int(5)
NO SQL
begin
declare i int default 0;
set i = floor(10+rand()*500);
return i;
end $$
delimiter ;
版主你能解释下那个错误是因为什么原因吗?还有你那句 NO SQL 就是通知mysql说我这个函数不需要sql语句是吧?还有就是因为我们这学期学的就是《数据库系统概论(第四版)》 这本书,所以那些基本概念和知识我应该都了解了,手册的话,现在正在看着呢。我想找些数据库设计的案例的书来看看,你有推荐的么?