当前位置:网站首页>Little known MySQL import data

Little known MySQL import data

2022-06-27 21:45:00 sorghum

source command


mysql -uroot -p
source E:/data.sql  Notice that there are no quotes 

load data command


mysql -uroot -p
load data local infile "E:/data.sql" into table database.`student` fields terminated by "\t" lines terminated by "\n";


 Parameter description  
database.`student` :  Which table represents the database 
fields terminated by "\t" lines :  Represents the field separator   tabs 
lines terminated by "\n" :  Represents that each line of data is separated by a newline symbol 
 Strict import data.sql data format ( With the help of Navicat Perfect export custom text format )
1: Beijing 
2: Shanghai 
3: Guangzhou 

mysqlimport


mysqlimport -h localhost -uroot -p  --fields-terminated-by=\t --local database E:/student.txt --compress=true --verbose=true


 Parameter description  
--fields-terminated-by= \t  Represents the field separator   tabs 
--local database E:/student.txt :  Which database does it represent student surface 
--compress=true :  Represents the use of compression protocols to speed up import 
--verbose=true :  Represents the display of detailed import information 
mysqlimport It's right load data Packaging 


 Three methods of import speed comparison  source < load data = mysqlimport
 Actually import 10million data  mysqlimport Time consuming 5 minute   The speed is still considerable 
 Add later kettle Open source tools import large amounts of data 

 Actually measured kettle Speed and mysqlimport Quite a   But the visualization operation is relatively simple 
 Operation steps  [ Add link description ](http://www.kettle.net.cn/2108.html)

原网站

版权声明
本文为[sorghum]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/178/202206271923210333.html