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

posted on 2022-01-05 23:28  heidsoft  阅读(343)  评论(0编辑  收藏  举报