user2723240
user2723240

Reputation: 823

MYSQL 0 rows affected in import

I'm uploading a csv from windows excel into a mysql database with the following code.

load data infile 'C:\\Users/path/Desktop/name.csv' into Table tablename
fields terminated by ',' 
lines terminated by '/r/n'
ignore 1 rows
;

When I run the code I get the result:

Query OK, 0 rows affected(0.01 sec)
Records: 0 Deleted: 0 Skipped: 0 Warnings: 0

It's my first time with mysql, so sorry about the really easy question.

Upvotes: 0

Views: 2978

Answers (1)

user2723240
user2723240

Reputation: 823

I needed to add local to the file so the final looks like

load data local infile 'C:path.csv' into Table tablename
fields terminated by ',' 
lines terminated by ';'
ignore 1 rows
;

Upvotes: 2

Related Questions