Introduction to mysqlimport

Source: Internet
Author: User
Tags processing text

the mysqlimport client provides a command line interface for the load data infileql statement. Most of mysqlimport options correspond directly to the load data infile clause.

options:

-- Host = host_name, -H host_name

import data to the MySQL server on the given host. The default host is localhost.

-- local, -l

Read the input file from the local client.

-- lock-tables, -l

lock all tables before processing text files for writing. This ensures that all tables are synchronized on the server.

-- password [= PASSWORD], -P [Password]

password used to connect to the server. If you use the short option format (-P), there must be no space between the option and password. If there is no password value after the -- password or-P option in the command line, a prompt is displayed for entering a password.

-- Port = port_num, -P port_num

the TCP/IP Port number used for connection.

-- protocol = {tcp | socket | pipe | memory}

connection protocol used.

-- replace, -r

the -- replace and -- ignore options control the processing of input records that have been copied to a unique key value. If -- replace is specified, the new line replaces existing rows with the same unique key value. If -- ignore is specified, the input row that copies the unique key value is skipped. If these two options are not specified, an error occurs when a duplicate key value is found and the remaining part of the text file is ignored.

-- fields-terminated-by =... // field separator

example

shell> mysqlimport -- local test imptest.txt

test. imptest: records: 2 deleted: 0 skipped: 0 Warnings: 0

Original article:

Http://www.lamppr.com/docs/mysql/client-side-scripts.html#mysqlimport

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.