
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
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
Frequently Used MySQL Import Options for Command Line
mysqlimport can be run with a number of options. Followings are some options for mysqlimport and their effect on import.
Option |
Action |
-r or –replace |
Cause imported rows to overwrite existing rows if they have the same unique key value. |
-i or –ignore |
Ignore rows that have the same unique key value as existing rows. |
-f or –force |
Force mysqlimport to continue inserting data even if errors are encountered. |
-l or --lock-tables |
Lock each table before importing (a good option on a busy server). |
-d or –delete |
Empty the table before inserting. |
--fields-terminated- by='char' |
Specify the separator used between values of the same row, default \t (tab). |
--fields-enclosed- by='char' |
Specify the delimiter that encloses each field; default is none. |
--fields-optionally- enclosed-by='char' |
Same as --fields-enclosed-by, but delimiter is used only to enclose string-type columns; default is none. |
--fields-escaped- by='char' |
Specify the escape character placed before special characters; default is \ (backslash, which if specified would be '\'). |
--lines-terminated-by='char' |
Specify the separator used to terminate each row of data; default is (newline). |
-u or –user |
Specify your username; default is Unix login name. |
-p or –password |
Specify your password. |
-h or –host |
Import into MySQL on the named host; default is localhost. |
-s or –silent |
Silent mode; output appears only when errors occur. |
-v or –verbose |
Verbose mode, print more commentary. |
-L or local |
Name a local file on the client. |
-V or –version |
Print program version information and exit. |
-? or –help |
Print help message and exit. |
Advertisements