Name

mysqlimport

Synopsis

mysqlimport [options] database filename

Use this to import data and table structures from a text file given as the third argument, into a database named in the second argument of the utility. This utility interacts with the server and uses the LOAD DATA INFILE statement. The root name of the text file being imported must be the same as the table name. Additional text files may be given in a space-separated list. Options may be given on the command line as the first argument to the utility or they may be provided in the server's configuration file (e.g., my.cnf) under the heading [client] or [mysqlimport]. When included in the configuration file, options appear without the leading double dashes. Here is an alphabetical list of options you can give for the first argument along with an explanation of each:

--character-sets-dir= name

Specifies the directory containing character sets.

--columns= columns , -c columns

Identifies the order of fields in the text file as they relate to the columns in the table. Columns are given in a comma-separated list.

--compress, -C

Instructs the utility to compress data passed between it and the server if supported.

--debug[= options ], -# options

Instructs the utility to write debugging information to the log specified along with various settings (e.g., 'd:t:o,logname').

--default-character-set= set

Specifies the default character set.

--defaults-extra-file= filename

Instructs the utility to accept additional options from the ...

Get MySQL in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.