mysqlimport --helpの内容 csvファイルの内容をデータベースにインポートする


mysqlimport --help の内容を以下に付しておく。



mysqlimport Ver 3.7 Distrib 5.1.73, for debian-linux-gnu (x86_64)
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its affiliates.
Other names may be trademarks of their respective owners.

Loads tables from text files in various formats.
The base name of the text file must be the name of the table that should be used.
If one uses sockets to connect to the MySQL server, the server will open and read the text file directly.
In other cases the client will open the text file.
The SQL command 'LOAD DATA INFILE' is used to import the rows.

Usage: mysqlimport [OPTIONS] database textfile...

Default options are read from the following files in the given order:
/etc/my.cnf /etc/mysql/my.cnf /usr/etc/my.cnf ~/.my.cnf
The following groups are read: mysqlimport client
The following options may be given as the first argument:

Print the program argument list and exit.

Don't read default options from any option file.

Only read default options from the given file #.

Read this file after the global files are read.

Directory for character set files.

Set the default character set.

-c, --columns=name
Use only these columns to import the data to. Give the column names in a comma separated list.
This is same as giving columns to LOAD DATA INFILE.

-C, --compress
Use compression in server/client protocol.

-#, --debug[=name]
Output debug log. Often this is 'd:t:o,filename'.

Check memory and open file usage at exit.

Print some debug info at exit.

-d, --delete
First delete all rows from table.

Fields in the input file are terminated by the given string.

Fields in the import file are enclosed by the given character.

Fields in the input file are optionally enclosed by the given character.

Fields in the input file are escaped by the given character.

-f, --force
Continue even if we get an SQL error.

-?, --help
Displays this help and exits.

-h, --host=name
Connect to host.

-i, --ignore
If duplicate unique key was found, keep old row.

Ignore first n lines of data infile.

Lines in the input file are terminated by the given string.

-L, --local
Read all files through the client.

-l, --lock-tables
Lock all tables for write (this disables threads).

Use LOW_PRIORITY when updating the table.

-p, --password[=name]
Password to use when connecting to server.
If password is not given it's asked from the tty.

-P, --port=#
Port number to use for connection or 0 for default to, in order of preference,
my.cnf, $MYSQL_TCP_PORT, /etc/services, built-in default (3306).

The protocol to use for connection (tcp, socket, pipe, memory).

-r, --replace
If duplicate unique key was found, replace old row.

-s, --silent
Be more silent.

-S, --socket=name
The socket file to use for connection.

Enable SSL for connection (automatically enabled with other flags).Disable with --skip-ssl.

CA file in PEM format (check OpenSSL docs, implies --ssl).

CA directory (check OpenSSL docs, implies --ssl).

X509 cert in PEM format (implies --ssl).

SSL cipher to use (implies --ssl).

X509 key in PEM format (implies --ssl).

Verify server's "Common Name" in its cert against hostname used when connecting.
This option is disabled by default.

Load files in parallel.
The argument is the number of threads to use for loading data.

-u, --user=name
User for login if not current user.

-v, --verbose
Print info about the various stages.

-V, --version
Output version information and exit.






関連:csvファイルのMySQLへのインポート(LOAD DATA LOCAL INFILE,mysqlimport)さくらインターネット

基礎からのMySQL 改訂版 (プログラマの種シリーズ SE必修! )
西沢 夢路
売り上げランキング: 4,031

プレイステーション クラシック
2018年12月発売 20タイトル収録
2019年9月発売 42タイトル収録
2019年9月発売 42タイトル収録
PCエンジン mini
2020年3月発売 58タイトル収録

-コンピュータ, データベース

Copyright© , 2021 All Rights Reserved.