[Techtalk] mysqlimport importing problems

Charlotte Oliver COliver at casedesign.com
Thu Nov 21 12:55:00 EST 2002


Hiya 'chix --

I am in the process of converting an inventory database at work from
Access to MySql.  (Yay!)

I'm running into some problems with mysqlimport.

I've saved the table from Access into a text file, where values are
separated by whitespace.
It looks like this:

root at www-rt:/usr/local/bin# cat
/home/cmoliver/CaseComputersImports/AssetCategories.txt
1          Computer
2          Monitor
3          Printer
4          Notebook
5          Network Hardware
6          Other
7          Non-MIS

I use this command to import the table into mysql:

root at www-rt:/usr/local/bin# ./mysqlimport
--columns=AssetCatID,AssetCategory -d -p CaseComputers
/home/cmoliver/CaseComputersImports/AssetCategories.txt
Enter password:
CaseComputers.AssetCategories: Records: 7  Deleted: 0  Skipped: 0
Warnings: 14

This is my output in MySql:

mysql> select * from AssetCategories;
+------------+---------------+
| AssetCatID | AssetCategory |
+------------+---------------+
|          1 |               |
|          2 |               |
|          3 |               |
|          4 |               |
|          5 |               |
|          6 |               |
|          7 |               |
+------------+---------------+
7 rows in set (0.00 sec)


HELP!  As you can see, half the file (the numbers) imports, but the
AssetCategory column doesn't.

I've also tried this with comma separated values, using the command:

cmoliver at www-rt:~/CaseComputersImports$ cat AssetCategories.csv
1,"Computer"
2,"Monitor"
3,"Printer"
4,"Notebook"
5,"Network Hardware"
6,"Other"
7,"Non-MIS"

cmoliver at www-rt:./mysqlimport --columns=AssetCatID,AssetCategory
--fields-optionally-enclosed-by='"' -d -p CaseComputers
/home/cmoliver/CaseComputersImports/AssetCategories.csv

I get the same results.

What am I doing wrong?

---
Charlotte Oliver
Junior Systems Engineer 
Case Design/Remodeling, Inc.



More information about the Techtalk mailing list