2 .\" Title: \fBmysqlimport\fR
3 .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
4 .\" Generator: DocBook XSL Stylesheets v1.77.1 <http://docbook.sf.net/>
6 .\" Manual: MySQL Database System
10 .TH "\FBMYSQLIMPORT\FR" "1" "11/04/2013" "MySQL 5\&.1" "MySQL Database System"
11 .\" -----------------------------------------------------------------
12 .\" * Define some portability stuff
13 .\" -----------------------------------------------------------------
14 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15 .\" http://bugs.debian.org/507673
16 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
17 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
20 .\" -----------------------------------------------------------------
21 .\" * set default formatting
22 .\" -----------------------------------------------------------------
23 .\" disable hyphenation
25 .\" disable justification (adjust text to left margin only)
27 .\" -----------------------------------------------------------------
28 .\" * MAIN CONTENT STARTS HERE *
29 .\" -----------------------------------------------------------------
34 .\" text files: importing
36 mysqlimport \- a data import program
38 .HP \w'\fBmysqlimport\ [\fR\fB\fIoptions\fR\fR\fB]\ \fR\fB\fIdb_name\fR\fR\fB\ \fR\fB\fItextfile1\fR\fR\fB\ \&.\&.\&.\fR\ 'u
39 \fBmysqlimport [\fR\fB\fIoptions\fR\fR\fB] \fR\fB\fIdb_name\fR\fR\fB \fR\fB\fItextfile1\fR\fR\fB \&.\&.\&.\fR
44 client provides a command\-line interface to the
46 SQL statement\&. Most options to
48 correspond directly to clauses of
51 Section\ \&13.2.6, \(lqLOAD DATA INFILE Syntax\(rq\&.
61 shell> \fBmysqlimport [\fR\fB\fIoptions\fR\fR\fB] \fR\fB\fIdb_name\fR\fR\fB \fR\fB\fItextfile1\fR\fR\fB [\fR\fB\fItextfile2\fR\fR\fB \&.\&.\&.]\fR
67 For each text file named on the command line,
69 strips any extension from the file name and uses the result to determine the name of the table into which to import the file\*(Aqs contents\&. For example, files named
73 all would be imported into a table named
77 supports the following options, which can be specified on the command line or in the
81 groups of an option file\&.
83 also supports the options for processing option files described at
84 Section\ \&4.2.3.4, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&.
94 .\" mysqlimport: help option
95 .\" help option: mysqlimport
99 Display a help message and exit\&.
110 .\" mysqlimport: bind-address option
111 .\" bind-address option: mysqlimport
112 \fB\-\-bind\-address=\fR\fB\fIip_address\fR\fR
114 On a computer having multiple network interfaces, this option can be used to select which interface is employed when connecting to the MySQL server\&.
116 This option is supported only in the version of
118 that is supplied with MySQL Cluster, beginning with MySQL Cluster NDB 6\&.3\&.4\&. It is not available in standard MySQL 5\&.1 releases\&.
129 .\" mysqlimport: character-sets-dir option
130 .\" character-sets-dir option: mysqlimport
131 \fB\-\-character\-sets\-dir=\fR\fB\fIpath\fR\fR
133 The directory where character sets are installed\&. See
134 Section\ \&10.5, \(lqCharacter Set Configuration\(rq\&.
145 .\" mysqlimport: columns option
146 .\" columns option: mysqlimport
147 \fB\-\-columns=\fR\fB\fIcolumn_list\fR\fR,
148 \fB\-c \fR\fB\fIcolumn_list\fR\fR
150 This option takes a comma\-separated list of column names as its value\&. The order of the column names indicates how to match data file columns with table columns\&.
161 .\" mysqlimport: compress option
162 .\" compress option: mysqlimport
166 Compress all information sent between the client and the server if both support compression\&.
177 .\" mysqlimport: debug option
178 .\" debug option: mysqlimport
179 \fB\-\-debug[=\fR\fB\fIdebug_options\fR\fR\fB]\fR,
180 \fB\-# [\fR\fB\fIdebug_options\fR\fR\fB]\fR
182 Write a debugging log\&. A typical
185 \*(Aqd:t:o,\fIfile_name\fR\*(Aq\&. The default is
197 .\" mysqlimport: debug-check option
198 .\" debug-check option: mysqlimport
199 \fB\-\-debug\-check\fR
201 Print some debugging information when the program exits\&. This option was added in MySQL 5\&.1\&.21\&.
212 .\" mysqlimport: debug-info option
213 .\" debug-info option: mysqlimport
214 \fB\-\-debug\-info\fR
216 Print debugging information and memory and CPU usage statistics when the program exits\&. This option was added in MySQL 5\&.1\&.14\&.
227 .\" mysqlimport: default-character-set option
228 .\" default-character-set option: mysqlimport
229 \fB\-\-default\-character\-set=\fR\fB\fIcharset_name\fR\fR
233 as the default character set\&. See
234 Section\ \&10.5, \(lqCharacter Set Configuration\(rq\&.
236 Some options, such as
237 \fB\-\-opt\fR, automatically enable
238 \fB\-\-lock\-tables\fR\&. If you want to override this, use
239 \fB\-\-skip\-lock\-tables\fR
240 at the end of the option list\&.
251 .\" mysqlimport: delete option
252 .\" delete option: mysqlimport
256 Empty the table before importing the text file\&.
267 .\" mysqldump: fields-terminated-by option
268 .\" fields-terminated-by option: mysqldump
269 \fB\-\-fields\-terminated\-by=\&.\&.\&.\fR,
270 .\" mysqldump: fields-enclosed-by option
271 .\" fields-enclosed-by option: mysqldump
272 \fB\-\-fields\-enclosed\-by=\&.\&.\&.\fR,
273 .\" mysqldump: fields-optionally-enclosed-by option
274 .\" fields-optionally-enclosed-by option: mysqldump
275 \fB\-\-fields\-optionally\-enclosed\-by=\&.\&.\&.\fR,
276 .\" mysqldump: fields-escaped-by option
277 .\" fields-escaped-by option: mysqldump
278 \fB\-\-fields\-escaped\-by=\&.\&.\&.\fR
280 These options have the same meaning as the corresponding clauses for
281 LOAD DATA INFILE\&. See
282 Section\ \&13.2.6, \(lqLOAD DATA INFILE Syntax\(rq\&.
293 .\" mysqlimport: force option
294 .\" force option: mysqlimport
298 Ignore errors\&. For example, if a table for a text file does not exist, continue processing any remaining files\&. Without
301 exits if a table does not exist\&.
312 .\" mysqlimport: host option
313 .\" host option: mysqlimport
314 \fB\-\-host=\fR\fB\fIhost_name\fR\fR,
315 \fB\-h \fR\fB\fIhost_name\fR\fR
317 Import data to the MySQL server on the given host\&. The default host is
329 .\" mysqlimport: ignore option
330 .\" ignore option: mysqlimport
334 See the description for the
347 .\" mysqlimport: ignore-lines option
348 .\" ignore-lines option: mysqlimport
349 \fB\-\-ignore\-lines=\fR\fB\fIN\fR\fR
353 lines of the data file\&.
364 .\" mysqldump: lines-terminated-by option
365 .\" lines-terminated-by option: mysqldump
366 \fB\-\-lines\-terminated\-by=\&.\&.\&.\fR
368 This option has the same meaning as the corresponding clause for
369 LOAD DATA INFILE\&. For example, to import Windows files that have lines terminated with carriage return/linefeed pairs, use
370 \fB\-\-lines\-terminated\-by="\er\en"\fR\&. (You might have to double the backslashes, depending on the escaping conventions of your command interpreter\&.) See
371 Section\ \&13.2.6, \(lqLOAD DATA INFILE Syntax\(rq\&.
382 .\" mysqlimport: local option
383 .\" local option: mysqlimport
387 Read input files locally from the client host\&.
398 .\" mysqlimport: lock-tables option
399 .\" lock-tables option: mysqlimport
400 \fB\-\-lock\-tables\fR,
405 tables for writing before processing any text files\&. This ensures that all tables are synchronized on the server\&.
416 .\" mysqlimport: low-priority option
417 .\" low-priority option: mysqlimport
418 \fB\-\-low\-priority\fR
422 when loading the table\&. This affects only storage engines that use only table\-level locking (such as
436 .\" mysqlimport: password option
437 .\" password option: mysqlimport
438 \fB\-\-password[=\fR\fB\fIpassword\fR\fR\fB]\fR,
439 \fB\-p[\fR\fB\fIpassword\fR\fR\fB]\fR
441 The password to use when connecting to the server\&. If you use the short option form (\fB\-p\fR), you
443 have a space between the option and the password\&. If you omit the
449 option on the command line,
453 Specifying a password on the command line should be considered insecure\&. See
454 Section\ \&6.1.2.1, \(lqEnd-User Guidelines for Password Security\(rq\&. You can use an option file to avoid giving the password on the command line\&.
465 .\" mysqlimport: pipe option
466 .\" pipe option: mysqlimport
470 On Windows, connect to the server using a named pipe\&. This option applies only if the server supports named\-pipe connections\&.
481 .\" mysqlimport: port option
482 .\" port option: mysqlimport
483 \fB\-\-port=\fR\fB\fIport_num\fR\fR,
484 \fB\-P \fR\fB\fIport_num\fR\fR
486 The TCP/IP port number to use for the connection\&.
497 .\" mysqlimport: protocol option
498 .\" protocol option: mysqlimport
499 \fB\-\-protocol={TCP|SOCKET|PIPE|MEMORY}\fR
501 The connection protocol to use for connecting to the server\&. It is useful when the other connection parameters normally would cause a protocol to be used other than the one you want\&. For details on the permissible values, see
502 Section\ \&4.2.2, \(lqConnecting to the MySQL Server\(rq\&.
513 .\" mysqlimport: replace option
514 .\" replace option: mysqlimport
522 options control handling of input rows that duplicate existing rows on unique key values\&. If you specify
523 \fB\-\-replace\fR, new rows replace existing rows that have the same unique key value\&. If you specify
524 \fB\-\-ignore\fR, input rows that duplicate an existing row on a unique key value are skipped\&. If you do not specify either option, an error occurs when a duplicate key value is found, and the rest of the text file is ignored\&.
535 .\" mysqlimport: silent option
536 .\" silent option: mysqlimport
540 Silent mode\&. Produce output only when errors occur\&.
551 .\" mysqlimport: socket option
552 .\" socket option: mysqlimport
553 \fB\-\-socket=\fR\fB\fIpath\fR\fR,
554 \fB\-S \fR\fB\fIpath\fR\fR
557 localhost, the Unix socket file to use, or, on Windows, the name of the named pipe to use\&.
568 .\" mysqlimport: SSL options
569 .\" SSL options: mysqlimport
572 Options that begin with
574 specify whether to connect to the server using SSL and indicate where to find SSL keys and certificates\&. See
575 Section\ \&6.3.6.4, \(lqSSL Command Options\(rq\&.
586 .\" mysqlimport: user option
587 .\" user option: mysqlimport
588 \fB\-\-user=\fR\fB\fIuser_name\fR\fR,
589 \fB\-u \fR\fB\fIuser_name\fR\fR
591 The MySQL user name to use when connecting to the server\&.
602 .\" mysqlimport: use-threads option
603 .\" use-threads option: mysqlimport
604 \fB\-\-use\-threads=\fR\fB\fIN\fR\fR
606 Load files in parallel using
608 threads\&. This option was added in MySQL 5\&.1\&.7\&.
619 .\" mysqlimport: verbose option
620 .\" verbose option: mysqlimport
624 Verbose mode\&. Print more information about what the program does\&.
635 .\" mysqlimport: version option
636 .\" version option: mysqlimport
640 Display version information and exit\&.
643 Here is a sample session that demonstrates use of
650 shell> \fBmysql \-e \*(AqCREATE TABLE imptest(id INT, n VARCHAR(30))\*(Aq test\fR
659 shell> \fBod \-c imptest\&.txt\fR
660 0000000 1 0 0 \et M a x S y d o w \en 1 0
661 0000020 1 \et C o u n t D r a c u l a \en
663 shell> \fBmysqlimport \-\-local test imptest\&.txt\fR
664 test\&.imptest: Records: 2 Deleted: 0 Skipped: 0 Warnings: 0
665 shell> \fBmysql \-e \*(AqSELECT * FROM imptest\*(Aq test\fR
666 +\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+
668 +\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+
670 | 101 | Count Dracula |
671 +\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+
679 Copyright \(co 1997, 2013, Oracle and/or its affiliates. All rights reserved.
681 This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
683 This documentation is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
685 You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/.
688 For more information, please refer to the MySQL Reference Manual,
689 which may already be installed locally and which is also available
690 online at http://dev.mysql.com/doc/.
692 Oracle Corporation (http://dev.mysql.com/).