Oracle 5.0 Reference Manual page 1093

Table of Contents

Advertisement

The character set indicated by the
interpret the information in the file.
not affect interpretation of input. If the contents of the input file use a character set that differs from the
default, it is usually preferable to specify the character set of the file by using the
clause, which is available as of MySQL 5.0.38. A character set of
LOAD DATA INFILE
data types of the columns into which field values are loaded. For proper interpretation of file contents,
you must ensure that it was written with the correct character set. For example, if you write a data file
with
or by issuing a
mysqldump -T
use a
--default-character-set
when the file is loaded with
Note that it is currently not possible to load data files that use the
If you use LOW_PRIORITY, execution of the
are reading from the table. This affects only storage engines that use only table-level locking (such as
MyISAM, MEMORY, and MERGE).
If you specify
CONCURRENT
is, it contains no free blocks in the middle), other threads can retrieve data from the table while
is executing. This option affects the performance of
DATA
using the table at the same time.
is not replicated. See
CONCURRENT
information.
The
keyword affects expected location of the file and error handling, as described later.
LOCAL
works only if your server and your client both have been configured to permit it. For example, if
was started with
--local-infile=0
with
LOAD DATA
LOCAL".
The
keyword affects where the file is expected to be found:
LOCAL
• If
is specified, the file is read by the client program on the client host and sent to the server.
LOCAL
The file can be given as a full path name to specify its exact location. If given as a relative path
name, the name is interpreted relative to the directory in which the client program was started.
When using
with
LOCAL
This is not the directory determined by the value of
but rather the operating system's temporary directory, and is not configurable in the MySQL Server.
(Typically the system temporary directory is
Windows.) Lack of sufficient space for the copy in this directory can cause the
statement to fail.
• If
is not specified, the file must be located on the server host and is read directly by the
LOCAL
server. The server uses the following rules to locate the file:
• If the file name is an absolute path name, the server uses it as given.
• If the file name is a relative path name with one or more leading components, the server searches
for the file relative to the server's data directory.
• If a file name with no leading components is given, the server looks for the file in the database
directory of the default database.
In the
non-LOCAL
case, these rules mean that a file named as
server's data directory, whereas the file named as
the default database. For example, if
reads the file
data.txt
loads the file into a table in the
LOAD DATA INFILE
character_set_database
SET NAMES
interprets all fields in the file as having the same character set, regardless of the
SELECT ... INTO OUTFILE
option so that output is written in the character set to be used
LOAD DATA
INFILE.
LOAD DATA
with a
table that satisfies the condition for concurrent inserts (that
MyISAM
Section 16.4.1.10, "Replication and
[462],
DATA, a copy of the file is created in the server's temporary directory.
LOAD
is the default database, the following
db1
from the database directory for db1, even though the statement explicitly
database:
db2
1073
Syntax
[442]
and the setting of
character_set_client
binary
ucs2
statement is delayed until no other clients
LOAD DATA
does not work. See
LOCAL
[502]
tmpdir
on Linux systems and
/tmp
./myfile.txt
is read from the database directory of
myfile.txt
system variable is used to
CHARACTER SET
specifies "no conversion."
statement in mysql, be sure to
character set.
a bit, even if no other thread is
Operations", for more
LOAD
Section 6.1.6, "Security Issues
or
slave_load_tmpdir
C:\WINDOWS\TEMP
LOAD DATA LOCAL
is read from the
LOAD DATA
[441]
do
LOAD
LOCAL
mysqld
[1465],
on
statement

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mysql 5.0

Table of Contents