- Learn MySQL
- MySQL - Home
- MySQL - Introduction
- MySQL - Installation
- MySQL - Administration
- MySQL - PHP Syntax
- MySQL - Connection
- MySQL - Create Database
- MySQL - Drop Database
- MySQL - Select Database
- MySQL - Data Types
- MySQL - Create Tables
- MySQL - Drop Tables
- MySQL - Insert Query
- MySQL - Select Query
- MySQL - Where Clause
- MySQL - Update Query
- MySQL - Delete Query
- MySQL - Like Clause
- MySQL - Sorting Results
- MySQL - Using Join
- MySQL - NULL Values
- MySQL - Regexps
- MySQL - Transactions
- MySQL - Alter Command
- MySQL - Indexes
- MySQL - Temporary Tables
- MySQL - Clone Tables
- MySQL - Database Info
- MySQL - Using Sequences
- MySQL - Handling Duplicates
- MySQL - SQL Injection
- MySQL - Database Export
- MySQL - Database Import
mysqlimport - A MySQL Data Import Program
The mysqlimport client comes with a command-line interface that helps with the LOAD DATA SQL statement. Most options to mysqlimport respond directly to clauses of LOAD DATA syntax
The utility mysqlimport can be invoked as shown below −
shell> mysqlimport [options] db_name textfile1 [textfile2 ...]
For every text file that is named on the command line, mysqlimport strips any extension from the file name and uses the result to figure out the name of the table into which the file's contents have to be imported.
Let us take an example: Files named sample.txt, sample.text, and sample all would be imported into a table named sample.
This utlity supports the following options, which can be specified on the command line or in the [mysqlimport] and [client] groups of an option file.
If the computer has multiple network interfaces, this option can be used to select which interface needs to be used to connect to the MySQL server.
It is the directory where character sets are installed.
--columns=column_list, -c column_list
It takes a list of comma-separated column names as its value. The order of the column names indicate how data file columns have to be matched with the table columns.
It compresses all information sent between the client and the server if possible.
It refers to the permitted compression algorithms for connections to the server. The available algorithms are the same as that for the protocol_compression_algorithms system variable. The default value is uncompressed.
It enables the mysql_clear_password cleartext authentication plugin.
This option ignores the errors. Let us take an example: If a table for a text file does not exist, continue processing the remaining files. Without --force, mysqlimport exits if a table does not exist.
- Related Articles
- How can we import CSV files into MySQL tables by using mysqlimport?
- How can we upload data into MySQL tables by using mysqlimport?
- How can we upload data into multiple MySQL tables by using mysqlimport?
- How can we import data from .txt file into MySQL table?
- How can we import data from .CSV file into MySQL table?
- What are some frequently used mysqlimport options while uploading the data into MySQL table through command line?
- How can we MySQL LOAD DATA INFILE statement with ‘ENCLOSED BY’ option to import data from text file into MySQL table?
- How can we MySQL LOAD DATA INFILE statement with ‘FIELDS TERMINATED BY’ option to import data from text file into MySQL table?
- How to Import a CSV file into a MySQL Database
- How can we import the text file, having data on the same line with a separator, into MySQL table?
- How to import csv file data from Github in R?
- How to Import and Export MySQL Databases in Linux
- Import a module in Python
- Do I need to import the Java.lang package anytime during running a program?