ak010
asked on
#1062 - Duplicate entry '1' for key 'PRIMARY'
Hello,
I'm running XAMPP on Windows locally. Trying to import a large SQL file into MySQLwith content I am not familiar with, using phpMyAdmin (doing a demo). The error message I'm getting is: #1062 - Duplicate entry '1' for key 'PRIMARY'.
When I attempt the same on my hosting server, the error message is #1062 - Duplicate entry '1' for key '1'. "Do not use AUTO_INCREMENT for zero values" is checked by default on the web hosting server.
phpMyAdmin that I'm using locally is an older version and the option "Do not use AUTO_INCREMENT for zero values" is not available.
I would greatly appreciate any help.
I'm running XAMPP on Windows locally. Trying to import a large SQL file into MySQLwith content I am not familiar with, using phpMyAdmin (doing a demo). The error message I'm getting is: #1062 - Duplicate entry '1' for key 'PRIMARY'.
When I attempt the same on my hosting server, the error message is #1062 - Duplicate entry '1' for key '1'. "Do not use AUTO_INCREMENT for zero values" is checked by default on the web hosting server.
phpMyAdmin that I'm using locally is an older version and the option "Do not use AUTO_INCREMENT for zero values" is not available.
I would greatly appreciate any help.
ASKER
GH,
Thank you for your response. Here is the table structure and the two lines of data as requested.
AK010 db-error.txt
Thank you for your response. Here is the table structure and the two lines of data as requested.
AK010 db-error.txt
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
Basically, it is telling you that you are trying to insert a row, with a value for the primary key field, which has already been used. Let use an example:
Open in new window
Now lets say you try to insert another row:
Open in new window
...As the key has already been used, you will be warned that you are trying to add a duplicate entry.
The solution here will be to take a look at your data, and see exactly what you are trying to import. Can you please give us the table structure, and two line of data for your table.
GH