查看定义的函数
show function status;
- 定义的函数不是全局的,作用域是当前的数据库。定义在数据库A的函数,在当前链接的数据库是 B 时,不可以直接调用。

其他
自定义函数 random_str .
delimiter $$
CREATE FUNCTION random_str(n int) RETURNS varchar(255)
begin
declare chars_str varchar(100)
default "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-";
declare return_str varchar(255) default "";
declare i int default 0;
while i < n do
set return_str=concat(return_str,substring(chars_str,floor(1+rand()*52),1));
set i= i+1;
end while;
return return_str;
end $$
delimiter ;
