Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
I have made a database and want to import a *.csv file to create records. Now I know PHPMyadmin will do this but when i select the CSV option under import and try to import i get an error saying that the file is invalid.
I made sure the different signs are correct before importing (on the import page). I created the file in excel and saved as a csv.
Please Help
Tim

If you are one of the many people trying to import a CSV file into MySQL using mysqlimport under MS-Windows command/DOS prompt, try the following:
mysqlimport --fields-optionally-enclosed-by=""" --fields-terminated-by=, --lines-terminated-by="\r\n" --user --password DATABASE 1.csv
BTW, you can export one CSV file using PHPMyadmin, then open it, you can find what format that PHPMyadmin need.
good luck.

Keep in mind that your imported text file should
have some value for empty fields. I regularly
build tables using msqlimport to import
tab-delimited text files. My tables contain
integer fields, some of which are
auto_incremented and some are not. MYSQL will
let you represent empty fields as null text
strings, i.e., two tab characters back-to-back,
but I found this increments the warning count.
To solve this problem you must use some value
for empty fields. Since auto_increment fields
use 0 or NULL, one would think, incorrectly,
that you could use 0 or \N to represent a null
value in the import text file. You must 0 for
an auto_increment field. Using \N increments
the warning count. You should use \N for other
numeric fields where you want a null value.
This problem is especially perplexing because of
MySQL's inability to report the text of a
warning. It only reports a warning count.

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |