A
A
alex stephen2016-02-26 14:29:29
MySQL
alex stephen, 2016-02-26 14:29:29

How to fully import CSV into mysql?

In general, there is a csv file with 2.8M lines of data entered by users into the form.
It needs to be fully loaded into mysql table.

mysql> load data local infile 'myfile.csv' into table t1 fields terminated by ','
    ->   enclosed by '"'
    ->   lines terminated by '\n';

Query OK, 698770 rows affected, 65535 warnings (1 min 28.19 sec)
Records: 1432489  Deleted: 0  Skipped: 733719  Warnings: 3910895

As you can see, only 698K was filled from 2.8M. And yet, exactly 63535 (2^16) warnings.
What could be the reason? If the problem is the warning limit, how can I remove it? If, nevertheless, mysql cannot digest 2.1M rows, then how to find out why (perhaps there is a validator)?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladislav Yandimirkin, 2016-02-26
@vlaad360

I also had problems with this for a long time, this plugin for Excel helped here
https://www.mysql.com/why-mysql/windows/excel/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question