其他分享
首页 > 其他分享> > 千万数据快速模拟插入

千万数据快速模拟插入

作者:互联网

python -c "for i in range(1, 1+1000000): print(i)" > base.txt

mysql> use test;
ERROR 1049 (42000): Unknown database 'test'
mysql> use test01;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> show tables;
+------------------+
| Tables_in_test01 |
+------------------+
| t1 |
| tmp_table |
| ytt_pt1 |
+------------------+
3 rows in set (0.00 sec)

mysql> load data infile '/opt/base.txt' replace into table tmp_table;
Query OK, 1000000 rows affected (15.05 sec)
Records: 1000000 Deleted: 0 Skipped: 0 Warnings: 0

mysql>

https://zhuanlan.zhihu.com/p/74788180

标签:sec,千万,use,1000000,插入,+------------------+,mysql,table,模拟
来源: https://www.cnblogs.com/heidsoft/p/15769337.html