mysqlimport
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.
--character-sets-dir=pathThis option specifies the directory containing character sets.
--columns=columns,
-c columnsThis 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, -CThis 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
used.
--debug-checkThis option writes debugging information to the log when the utility ends. It’s available as of version 5.1.21 of MySQL.
--debug-infoThis option writes debugging information and CPU and memory usage information to the log after the utility ends.
--default-character-set=setThis option specifies the default character set.
--defaults-extra-file=filenameThis option takes additional options from the text file named.
--defaults-file=filenameThis option instructs the utility to accept options only from the text file named.
--delete, -dThis option deletes all data from each target table before importing data from the text file.
--fields-enclosed-by=charactersThis option identifies the characters that indicate the start and end of fields in the text file being imported.
--fields-escaped-by=characterThis option identifies the character that will escape special characters in the text file being imported. A backslash is the default.
--fields-optionally-enclosed-by=charactersThis option identifies the characters that indicate the start and end of fields in the text file being imported.
--fields-terminated-by=characterThis option identifies the character that indicates the end of fields in the text file being imported.
--force, -fThis option instructs the utility to continue importing data despite errors encountered.
--help, -?This option displays basic help information.
--host=host,
-h hostThis option specifies the name or IP address of the server for connection.
--ignore, -iThis option instructs the utility to ignore error messages regarding rows containing duplicate keys and thereby not to replace such rows with imported data.
--ignore-lines=numberThis option instructs the utility to ignore the first number of lines specified. It’s useful in skipping headings in the text file being imported.
--lines-terminated-by=characterThis option identifies the character that indicates the end of records in the text file being imported.
--local, -LThis option tells the utility that the text file to import is located locally on the client and not on the server, which is the default assumption.
--lock-tables, -lThis option locks all tables before importing data.
--low-priorityThis option has the utility use the LOW
PRIORITY keyword when importing data.
--no-defaultsThis option tells the utility not to accept options from a configuration file.
--password[=password],
-p[password]This option provides the password to pass to the server. A
space is not permitted after the -p option if
the password is given. If the password is not given, the user will
be prompted for one.
--port=port,
-P portThis option specifies the port number to use for connecting to the server.
--print-defaultsThis option displays related options found in the server’s configuration files.
--protocol=protocolThis option is used to specify the protocol to use when
connecting to the server. The choices are TCP,
SOCKET, PIPE, and
MEMORY.
--replace, -rThis option replaces rows that contain duplicate keys with the imported data.
--silent, -sThis option suppress all messages except for error messages.
--socket=filename,
-S filenameThis option provides the name of the server’s socket file.
--sslThis option specifies that secure SSL connections should be
used. It requires the server to have SSL enabled. If this option
is enabled on the utility by default, use --skip-ssl to disable it.
--ssl-ca=pem_fileThis option specifies the name of the file (i.e., the pem file) containing a list of trusted SSL CAs.
--ssl-capath=pathThis option specifies the path to the trusted certificates file (i.e., the pem file).
--ssl-cert=filenameThis option specifies the name of the SSL certificate file to use for SSL connections.
--ssl-cipher=ciphersThis option gives a list of ciphers that may be used for SSL encryption.
--ssl-key=filenameThis option specifies the SSL key file to use for secure connections.
--ssl-verify-server-certThis option verifies the client’s certificate against the server’s certificate for the client at startup. It is available as of version 5.1.11 of MySQL.
--user=user,
-u userThis option specifies the username for connecting to the server.
--verbose, -vThis option displays more information.
--version, -VThis option displays the version of the utility.