

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
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
Invoking mysqlimport
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.
Example
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.
--bind-address=ip_address
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.
--character-sets-dir=dir_name
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.
--compress, -C
It compresses all information sent between the client and the server if possible.
--compression-algorithms=value
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.
--enable-cleartext-plugin
It enables the mysql_clear_password cleartext authentication plugin.
--force, -f
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 Questions & Answers
- 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?
- Import a module in Python
- How can we import the text file, having data on the same line with a separator, 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 csv file data from Github in R?
- How to import local json file data to my JavaScript variable?
- Difference between import tkinter as tk and from tkinter import
- Do I need to import the Java.lang package anytime during running a program?
- Add data to existing data in a MySQL Database?