I use Navicat as my database tool. Others are similar. 1. Open navicat, there is a function menu under the corresponding database, right click to create a new function ==》Complete 2. Create a test table user. I am too lazy to write statements because everyone needs different tables. 3. Create a function and directly put the code! Note that the insert statement in the middle is replaced with the insert statement you need. You can use the random method to ensure that the generated data is different. CREATE DEFINER=`root`@`localhost` FUNCTION `ins_data`(`num` int) RETURNS int(11) BEGIN DECLARE i int DEFAULT 0; WHILE i<num DO INSERT INTO `user` (`name`,email,phone,sex,password,age,create_time) values(concat('User',i),'[email protected]' ,CONCAT('18',FLOOR(rand()*(999999999-100000000)+100000000)) ,FLOOR(RAND()*2),UUID(),FLOOR(RAND()*100) ,now()); set i = i+1; END WHILE; RETURN i; END 4. Test, the return value is the number of data generated. Note: It may take several minutes to generate 1 million pieces of data. Performing other operations during the process may result in failure. Done! This is the end of this article about MySQL automatic insertion of millions of simulated data. For more relevant MySQL automatic data insertion content, please search 123WORDPRESS.COM's previous articles or continue to browse the following related articles. I hope everyone will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: Practice of implementing custom search bar and clearing search events in avue
>>: How to remove the dotted border when clicking a link in FireFox
Table of contents 1. What is dynamic typing? 2. D...
I would like to share the Windows Server 2016 act...
introduction I discovered a problem before: somet...
Preface The simple understanding of MySQL permiss...
Table of contents Project Background Improvement ...
Table of contents illustrate 1. Enable Docker rem...
The web pinball game implemented using javeScript...
Table of contents Preliminary preparation Deploym...
1. Docker ps lists containers 2. Docker cp copies...
The following command is often used: chmod 777 文件...
Preface: MySQL master-slave architecture should b...
There are many ways to generate a global ID. Here...
Detailed explanation and summary of the URL for d...
Preface The Windows system that can be activated ...
Detailed explanation of linux touch command: 1. C...