2
.\" Title: \fBmysqlimport\fR
3
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
4
.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
6
.\" Manual: MySQL Database System
10
.TH "\FBMYSQLIMPORT\FR" "1" "11/15/2013" "MySQL 5\&.6" "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.\" help option: mysqlimport\fB\-\-help\fR,
97
Display a help message and exit\&.
108
.\" mysqlimport: bind-address option.\" bind-address option: mysqlimport\fB\-\-bind\-address=\fR\fB\fIip_address\fR\fR
110
On a computer having multiple network interfaces, this option can be used to select which interface is employed when connecting to the MySQL server\&.
112
This option is supported beginning with MySQL 5\&.6\&.1\&.
123
.\" mysqlimport: character-sets-dir option.\" character-sets-dir option: mysqlimport\fB\-\-character\-sets\-dir=\fR\fB\fIpath\fR\fR
125
The directory where character sets are installed\&. See
126
Section\ \&10.5, \(lqCharacter Set Configuration\(rq\&.
137
.\" mysqlimport: columns option.\" columns option: mysqlimport\fB\-\-columns=\fR\fB\fIcolumn_list\fR\fR,
138
\fB\-c \fR\fB\fIcolumn_list\fR\fR
140
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\&.
151
.\" mysqlimport: compress option.\" compress option: mysqlimport\fB\-\-compress\fR,
154
Compress all information sent between the client and the server if both support compression\&.
165
.\" mysqlimport: debug option.\" debug option: mysqlimport\fB\-\-debug[=\fR\fB\fIdebug_options\fR\fR\fB]\fR,
166
\fB\-# [\fR\fB\fIdebug_options\fR\fR\fB]\fR
168
Write a debugging log\&. A typical
171
\*(Aqd:t:o,\fIfile_name\fR\*(Aq\&. The default is
183
.\" mysqlimport: debug-check option.\" debug-check option: mysqlimport\fB\-\-debug\-check\fR
185
Print some debugging information when the program exits\&.
196
.\" mysqlimport: debug-info option.\" debug-info option: mysqlimport\fB\-\-debug\-info\fR
198
Print debugging information and memory and CPU usage statistics when the program exits\&.
209
.\" mysqlimport: default-character-set option.\" default-character-set option: mysqlimport\fB\-\-default\-character\-set=\fR\fB\fIcharset_name\fR\fR
213
as the default character set\&. See
214
Section\ \&10.5, \(lqCharacter Set Configuration\(rq\&.
225
.\" mysqlimport: default-auth option.\" default-auth option: mysqlimport\fB\-\-default\-auth=\fR\fB\fIplugin\fR\fR
227
The client\-side authentication plugin to use\&. See
228
Section\ \&6.3.7, \(lqPluggable Authentication\(rq\&.
230
This option was added in MySQL 5\&.6\&.2\&.
241
.\" mysqlimport: delete option.\" delete option: mysqlimport\fB\-\-delete\fR,
244
Empty the table before importing the text file\&.
255
.\" mysqldump: fields-terminated-by option.\" fields-terminated-by option: mysqldump\fB\-\-fields\-terminated\-by=\&.\&.\&.\fR,
256
.\" mysqldump: fields-enclosed-by option.\" fields-enclosed-by option: mysqldump\fB\-\-fields\-enclosed\-by=\&.\&.\&.\fR,
257
.\" mysqldump: fields-optionally-enclosed-by option.\" fields-optionally-enclosed-by option: mysqldump\fB\-\-fields\-optionally\-enclosed\-by=\&.\&.\&.\fR,
258
.\" mysqldump: fields-escaped-by option.\" fields-escaped-by option: mysqldump\fB\-\-fields\-escaped\-by=\&.\&.\&.\fR
260
These options have the same meaning as the corresponding clauses for
261
LOAD DATA INFILE\&. See
262
Section\ \&13.2.6, \(lqLOAD DATA INFILE Syntax\(rq\&.
273
.\" mysqlimport: force option.\" force option: mysqlimport\fB\-\-force\fR,
276
Ignore errors\&. For example, if a table for a text file does not exist, continue processing any remaining files\&. Without
279
exits if a table does not exist\&.
290
.\" mysqlimport: host option.\" host option: mysqlimport\fB\-\-host=\fR\fB\fIhost_name\fR\fR,
291
\fB\-h \fR\fB\fIhost_name\fR\fR
293
Import data to the MySQL server on the given host\&. The default host is
305
.\" mysqlimport: ignore option.\" ignore option: mysqlimport\fB\-\-ignore\fR,
308
See the description for the
321
.\" mysqlimport: ignore-lines option.\" ignore-lines option: mysqlimport\fB\-\-ignore\-lines=\fR\fB\fIN\fR\fR
325
lines of the data file\&.
336
.\" mysqldump: lines-terminated-by option.\" lines-terminated-by option: mysqldump\fB\-\-lines\-terminated\-by=\&.\&.\&.\fR
338
This option has the same meaning as the corresponding clause for
339
LOAD DATA INFILE\&. For example, to import Windows files that have lines terminated with carriage return/linefeed pairs, use
340
\fB\-\-lines\-terminated\-by="\er\en"\fR\&. (You might have to double the backslashes, depending on the escaping conventions of your command interpreter\&.) See
341
Section\ \&13.2.6, \(lqLOAD DATA INFILE Syntax\(rq\&.
352
.\" mysqlimport: local option.\" local option: mysqlimport\fB\-\-local\fR,
355
Read input files locally from the client host\&.
366
.\" mysqlimport: lock-tables option.\" lock-tables option: mysqlimport\fB\-\-lock\-tables\fR,
371
tables for writing before processing any text files\&. This ensures that all tables are synchronized on the server\&.
382
.\" mysqlimport: low-priority option.\" low-priority option: mysqlimport\fB\-\-low\-priority\fR
386
when loading the table\&. This affects only storage engines that use only table\-level locking (such as
400
.\" mysqlimport: password option.\" password option: mysqlimport\fB\-\-password[=\fR\fB\fIpassword\fR\fR\fB]\fR,
401
\fB\-p[\fR\fB\fIpassword\fR\fR\fB]\fR
403
The password to use when connecting to the server\&. If you use the short option form (\fB\-p\fR), you
405
have a space between the option and the password\&. If you omit the
411
option on the command line,
415
Specifying a password on the command line should be considered insecure\&. See
416
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\&.
427
.\" mysqlimport: pipe option.\" pipe option: mysqlimport\fB\-\-pipe\fR,
430
On Windows, connect to the server using a named pipe\&. This option applies only if the server supports named\-pipe connections\&.
441
.\" mysqlimport: plugin-dir option.\" plugin-dir option: mysqlimport\fB\-\-plugin\-dir=\fR\fB\fIpath\fR\fR
443
The directory in which to look for plugins\&. It may be necessary to specify this option if the
444
\fB\-\-default\-auth\fR
445
option is used to specify an authentication plugin but
447
does not find it\&. See
448
Section\ \&6.3.7, \(lqPluggable Authentication\(rq\&.
450
This option was added in MySQL 5\&.6\&.2\&.
461
.\" mysqlimport: port option.\" port option: mysqlimport\fB\-\-port=\fR\fB\fIport_num\fR\fR,
462
\fB\-P \fR\fB\fIport_num\fR\fR
464
The TCP/IP port number to use for the connection\&.
475
.\" mysqlimport: protocol option.\" protocol option: mysqlimport\fB\-\-protocol={TCP|SOCKET|PIPE|MEMORY}\fR
477
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
478
Section\ \&4.2.2, \(lqConnecting to the MySQL Server\(rq\&.
489
.\" mysqlimport: replace option.\" replace option: mysqlimport\fB\-\-replace\fR,
496
options control handling of input rows that duplicate existing rows on unique key values\&. If you specify
497
\fB\-\-replace\fR, new rows replace existing rows that have the same unique key value\&. If you specify
498
\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\&.
509
.\" mysqlimport: silent option.\" silent option: mysqlimport\fB\-\-silent\fR,
512
Silent mode\&. Produce output only when errors occur\&.
523
.\" mysqlimport: socket option.\" socket option: mysqlimport\fB\-\-socket=\fR\fB\fIpath\fR\fR,
524
\fB\-S \fR\fB\fIpath\fR\fR
527
localhost, the Unix socket file to use, or, on Windows, the name of the named pipe to use\&.
538
.\" mysqlimport: SSL options.\" SSL options: mysqlimport\fB\-\-ssl*\fR
540
Options that begin with
542
specify whether to connect to the server using SSL and indicate where to find SSL keys and certificates\&. See
543
Section\ \&6.3.9.4, \(lqSSL Command Options\(rq\&.
554
.\" mysqlimport: user option.\" user option: mysqlimport\fB\-\-user=\fR\fB\fIuser_name\fR\fR,
555
\fB\-u \fR\fB\fIuser_name\fR\fR
557
The MySQL user name to use when connecting to the server\&.
568
.\" mysqlimport: use-threads option.\" use-threads option: mysqlimport\fB\-\-use\-threads=\fR\fB\fIN\fR\fR
570
Load files in parallel using
583
.\" mysqlimport: verbose option.\" verbose option: mysqlimport\fB\-\-verbose\fR,
586
Verbose mode\&. Print more information about what the program does\&.
597
.\" mysqlimport: version option.\" version option: mysqlimport\fB\-\-version\fR,
600
Display version information and exit\&.
603
Here is a sample session that demonstrates use of
610
shell> \fBmysql \-e \*(AqCREATE TABLE imptest(id INT, n VARCHAR(30))\*(Aq test\fR
619
shell> \fBod \-c imptest\&.txt\fR
620
0000000 1 0 0 \et M a x S y d o w \en 1 0
621
0000020 1 \et C o u n t D r a c u l a \en
623
shell> \fBmysqlimport \-\-local test imptest\&.txt\fR
624
test\&.imptest: Records: 2 Deleted: 0 Skipped: 0 Warnings: 0
625
shell> \fBmysql \-e \*(AqSELECT * FROM imptest\*(Aq test\fR
626
+\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+
628
+\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+
630
| 101 | Count Dracula |
631
+\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+
639
Copyright \(co 1997, 2013, Oracle and/or its affiliates. All rights reserved.
641
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.
643
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.
645
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/.
648
For more information, please refer to the MySQL Reference Manual,
649
which may already be installed locally and which is also available
650
online at http://dev.mysql.com/doc/.
652
Oracle Corporation (http://dev.mysql.com/).