How To Load Data Files into Tables with "mysqlimport"

Q

How To Load Data Files into Tables with "mysqlimport"? - MySQL FAQs - Administrator Tools for Managing MySQL Server

✍: FYIcenter.com

A

If you want to load a data file directly into a table, you need to prepare the data file as one line per data row, and use tab character as the column delimiter. The data file name should match the target table name. The following is a good tutorial exercise on using "mysqlimport":

>cd \mysql\bin
>type \temp\links.tab
dev.fyicenter.com
www.mysql.com

>mysqlimport -u root test \temp\links.tab
test.links: Records: 2  Deleted: 0  Skipped: 0  Warnings: 0

>mysql -u root -e "SELECT * FROM links" test
+-------------------+
| name              |
+-------------------+
| dba.fyicenter.com |
| dev.fyicenter.com |
| www.mysql.com     |
+-------------------+

2007-05-11, 4877👍, 0💬