Databases Reference
In-Depth Information
CSV
From the
authors
table menu, we select
Import
, and then
CSV
.
We can influence the behavior of the import in a number of ways. By default,
importing does not modify existing data (based on primary or unique keys), but
the
Replace table data with file
option instructs phpMyAdmin to use
REPLACE
statements instead of
INSERT
; statement so that existing rows are replaced with the
imported data.
With
Ignore duplicate rows
,
INSERT
IGNORE
statements are generated. These cause
MySQL to ignore any duplicate key problems during insertion. A duplicate key from
the import file does not replace existing data, and the procedure continues for the
next line of CSV data.
We can then specify the character that terminates each field, the character that
encloses data, and the character that escapes the enclosing character. Usually this is
\
. For example, for a double quote enclosing character, if the data field contains a
double quote, it must be expressed as
"some data \" some other data"
.
For
Lines terminated by
, recent versions of phpMyAdmin offer the
auto
choice,
which should be tried first as it automatically detects the end-of-line character. We
Search WWH ::
Custom Search