mysqlimport


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 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 text file named.


--defaults-file= filename

Instructs the utility to accept options only from the text file named.


--delete, -d

Instructs the utility to delete all of the data from each target table before importing data from the text file.


--fields-enclosed-by= characters

Identifies the characters that indicate the start and end of fields in the text file being imported.


--fields-escaped-by= character

Identifies the character that will escape special characters in the text file being imported. Backslash is the default.


--fields-optionally-enclosed-by= characters

Identifies the characters that indicate the start and end of fields in the text file being imported.


--fields-terminated-by= character

Identifies the character that indicates the end of fields in the text file being imported.


--force, -f

Instructs the utility to continue importing data despite errors encountered.


--help, -?

Displays basic help information.


--host= host, -h host

Specifies the name or IP address of the server for connection.


--ignore, -i

Instructs the utility to ignore error messages regarding rows containing duplicate keys and thereby not to replace such rows with imported data.


--ignore-lines= number

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= character

Identifies the character that indicates the end of records in the text file being imported.


--local, -L

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, -l

Instructs the utility to lock all tables before importing data.


--low-priority

Has the utility use the LOW PRIORITY flag when importing data.


--no-defaults

Tells the utility not to accept options from a configuration file.


--password[= password], -p[ password]

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 port

Specifies the port number to use for connecting to the server.


--print-defaults

Displays related options found in the server's configuration files.


--protocol= protocol

Used to specify the protocol to use when connecting to the server. The choices are TCP, SOCKET, PIPE, and MEMORY.


--replace, -r

Instructs the utility to replace rows that contain duplicate keys with the imported data.


--silent, -s

Suppress all messages except for error messages.


--socket= filename, -S filename

Provides the path and name of the server's socket file.


--user= user, -u user

Specifies the username for connecting to the server.


--verbose, -v

Displays more information.


--version, -V

Displays the version of the utility.



MySQL in a Nutshell
MYSQL in a Nutshell (In a Nutshell (OReilly))
ISBN: 0596514336
EAN: 2147483647
Year: 2006
Pages: 134
Authors: Russell Dyer

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net