数据库
首页 > 数据库> > mysql随机生成百万条数据

mysql随机生成百万条数据

作者:互联网

建表
CREATE TABLE ts1 (a int, b int, index idx_a_b(a,b desc));



DELIMITER //
CREATE PROCEDURE ts_insert()
BEGIN     
    DECLARE i INT DEFAULT 1;
    WHILE i < 800
    DO
        insert into ts1 select RAND()*80000, RAND()*80000;
        SET i = i+1;
    END WHILE;
    commit;
END //
DELIMITER;

先执行上面的封装的函数

然后调用函数
CALL ts_insert();    

 

 

TRANSLATE with x English
Arabic Hebrew Polish
Bulgarian Hindi Portuguese
Catalan Hmong Daw Romanian
Chinese Simplified Hungarian Russian
Chinese Traditional Indonesian Slovak
Czech Italian Slovenian
Danish Japanese Spanish
Dutch Klingon Swedish
English Korean Thai
Estonian Latvian Turkish
Finnish Lithuanian Ukrainian
French Malay Urdu
German Maltese Vietnamese
Greek Norwegian Welsh
Haitian Creole Persian  
  TRANSLATE with COPY THE URL BELOW Back EMBED THE SNIPPET BELOW IN YOUR SITE Enable collaborative features and customize widget: Bing Webmaster Portal Back

标签:insert,ts,百万条,DELIMITER,随机,mysql,document,ts1,location
来源: https://www.cnblogs.com/Abner3721/p/15858366.html