It appears as though your key column has exceeded its numerical limit. Do
you have that column typed large enough to contain the data you are putting
into it? Your database will accept the first out-of-range value and re-size
it to the MAX of that column's datatype (int?). When the second
out-of-range number rolls in, that's when the error is thrown.

Check your input data to make sure it doesn't exceed the range of your
destination columns. You may need to use a larger datatype for that column.

Yours,
Shawn Green
Database Administrator
Unimin Corporation - Spruce Pine



                                                                                       
                                
                      Chip Wiegand                                                     
                                
                      <[EMAIL PROTECTED]        To:       [EMAIL PROTECTED]            
                             
                      rad.com>                 cc:                                     
                                
                                               Fax to:                                 
                                
                      07/08/2004 06:35         Subject:  problem importing .csv (excel 
format) into mysql              
                      PM                                                               
                                
                                                                                       
                                
                                                                                       
                                




I was sent an excel file from a remote office, and need to put the data
into a mysql database to be displayed on our web site. I removed a few
lines of fluff from the excel file and saved it as .csv (using .csv
(ms-dos)). When I try to import the file it gives me a duplicate entry for
key 1 error. I have looked through the file and the duplicate item it is
pointing to does not exist in the file. Here is the error:

mysql> load data infile '/usr/home/autopilots/whs4.csv'
    -> into table refurbs
    -> fields terminated by ','
    -> optionally enclosed by '"'
    -> lines terminated by '\n';
ERROR 1062: Duplicate entry '2147483647' for key 1

(When I try to import through phpMyAdmin-2.5.6 it doesn't work also, keeps
telling me to load a file, which is done by pressing Browse button.)

Any ideas what could cause it to fail on a non-existant key? Is there a
trick to loading Excel .csv files into mysql?

Thanks
--
Chip Wiegand
Computer Services
Simrad, Inc
www.simradusa.com
www.simrad.com
[EMAIL PROTECTED]

"When I'm working on a problem, I never think about beauty. I think only
how to solve the problem. But when I have finished, if the solution is not
beautiful, I know it is wrong." - R. Buckminster Fuller





-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to