sql random string教程
begin
declare chars\_str varchar(62) 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()*62),1));
set i=i+1;
end while;
return return\_str;
end