O'Reilly logo

MySQL in a Nutshell by Russell J.T. Dyer

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required