BULK INSERT in MYSQL

2019-01-06 16:51发布

On MS SQL, I can do bulk insert using the sql command below:

BULK INSERT myDatabase.MyTable FROM 'C:\MyTextFile.txt' WITH  FIELDTERMINATOR = ','

Now I want to do the same on MySQL but I can't seem to figure out how this works and what query to use.

标签: mysql insert
1条回答
2楼-- · 2019-01-06 16:57

In MySQL, the equivalent would be

LOAD DATA INFILE

http://dev.mysql.com/doc/refman/5.1/en/load-data.html

LOAD DATA INFILE 'C:\MyTextFile'
INTO TABLE myDatabase.MyTable
FIELDS TERMINATED BY ','
查看更多
登录 后发表回答