Recently on MySQL to build some data, involving random numbers
This is the creation of a 8-bit random string, with numbers and characters, created by the UUID.
SET @bian = (select Left ((select REPLACE (UUID (), '-', ')), 8));
Create a random date, date format can be modified
SET @datetime = (SELECT floor (1401675501 + (RAND () * 91675501)));
SET @finaldate = (SELECT from_unixtime (@datetime, '%y-%m-%d%h:%i:%s '));
2. Specific stored procedures
CREATE PROCEDURE pro15 () BEGIN DECLARE i INT DEFAULT 0;
Loop_label:loop SET @bian = (select Left ((select REPLACE (UUID (), '-', ')), 8));
SET @datetime = (SELECT floor (1401675501 + (RAND () * 91675501)));
SET @finaldate = (SELECT from_unixtime (@datetime, '%y-%m-%d%h:%i:%s '));
INSERT into App_cfg VALUES ("/pp/t1test1/test1", @bian, @bian, 0, @bian, "1.0.2", @finaldate, TRUE);
SET i = i + 1;
IF i >= 20000 then LEAVE Loop_label;
END IF;
END LOOP;
END;
This article is from the "Test Stars" blog, so be sure to keep this source http://nickren.blog.51cto.com/7892233/1729491
MySQL generates random numbers