当前位置:网站首页>鲜为人知的mysql导入数据
鲜为人知的mysql导入数据
2022-06-27 19:23:00 【高粱】
source命令
mysql -uroot -p
source E:/data.sql 注意这里没有引号
load data 命令
mysql -uroot -p
load data local infile "E:/data.sql" into table database.`student` fields terminated by "\t" lines terminated by "\n";
参数说明
database.`student` : 代表数据库哪张表
fields terminated by "\t" lines : 代表字段分隔符 制表符
lines terminated by "\n" : 代表每行数据通过换行符号分开
严格的导入data.sql数据格式(借助Navicat完美导出自定义文本格式)
1:北京
2:上海
3:广州
mysqlimport
mysqlimport -h localhost -uroot -p --fields-terminated-by=\t --local database E:/student.txt --compress=true --verbose=true
参数说明
--fields-terminated-by= \t 代表字段分隔符 制表符
--local database E:/student.txt : 代表哪个数据库student表
--compress=true : 代表使用压缩协议加快导入速度
--verbose=true : 代表显示详细导入信息
mysqlimport是对load data的包装
三种方法导入速度对比 source < load data = mysqlimport
实测导入一千万数据 mysqlimport耗时5分钟 速度还是相当可观的
后面补充kettle开源工具导入大量数据
实测kettle速度和mysqlimport相当 只是可视化操作比较简单
操作步骤 [添加链接描述](http://www.kettle.net.cn/2108.html)
边栏推荐
- gomock mockgen : unknown embedded interface
- SQL必需掌握的100个重要知识点:使用函数处理数据
- Codeforces Global Round 14
- Here are 12 commonly used function formulas for you. All used ones are good
- Unity3d button adapts the size according to the text content
- CEPH distributed storage
- Experiment of love number lesson | phase V - emotion judgment of commodity review based on machine learning method
- PCIE知识点-008:PCIE switch的结构
- 图解基于AQS队列实现的CountDownLatch和CyclicBarrier
- Go from introduction to practice - Interface (notes)
猜你喜欢
随机推荐
White whoring red team goby & POC, how do you call white whoring?
Go从入门到实战——CSP并发机制(笔记)
ICML2022 | 可扩展深度高斯马尔可夫随机场
Acwing周赛57-数字操作-(思维+分解质因数)
Share how I take notes
MySQL performance optimization index function, hidden, prefix, hash index usage (2)
空指针异常
Prospects for enterprise digitalization (38/100)
强制 20 天内开发 APP 后集体被裁,技术负责人怒批:祝“早日倒闭!”
微服务之远程调用
SQL必需掌握的100个重要知识点:过滤数据
100 important knowledge points that SQL must master: retrieving data
JPA踩坑系列之save方法
如何将队列里面的内容没秒钟执行一次优先级
创建对象时JVM内存结构
Acwing周赛57-最长连续子序列-(二分or树状数组)
抖音的兴趣电商已经碰到流量天花板?
TypeScript学习
图解基于AQS队列实现的CountDownLatch和CyclicBarrier
Educational Codeforces Round 108 (Rated for Div. 2)








