mysqlimport indicates a nonzero warning count when
you load a datafile into MySQL, but you have no idea which rows or
columns were problematic.
Run the file through a utility that diagnoses which data values caused the warnings.
As a bulk loader,
very efficient; it can run many times faster than a set of
INSERT statements that adds the same rows.
DATA also is not very informative. It returns only
a message that indicates the number of records processed, and a few
other status counts. For example, in the previous section, we
generated a datafile
managers.txt to use with
guess_table.pl for guessing the structure of the
If you create that table using the resulting
TABLE statement and then
load the datafile into it, you will observe the following result:
LOAD DATA LOCAL INFILE 'managers.txt' INTO TABLE managers->
IGNORE 1 LINES;Query OK, 2841 rows affected (0.06 sec) Records: 2841 Deleted: 0 Skipped: 0 Warnings: 5082
Evidently, there were a quite a few problems with the file.
Unfortunately, the message produced by
DATA doesn’t tell you anything
about which rows and columns caused them. The
mysqlimport program is similarly terse, because
its message is the same as the one returned by
We’ll revisit this example at the end of the
section, but first consider
DATA’s output style. On the one hand, the minimal-report approach is the ...