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. 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 of 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.

mysqlimport options

--character-sets-dir=path

This option specifies the directory containing character sets.

--columns=columns, -c columns

This option 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

This option compresses data passed between the utility and the server, if compression is supported.

--debug[=options], -# [options]

This option logs debugging information. The set of options used by default is 'd:t:o,logname'. See Table 16-1 at the end of the list of the mysqldump utility options earlier in this chapter for an explanation of these flags and others that may be ...

Get MySQL in a Nutshell, 2nd Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.