Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

MySQL database import error


jhande

Recommended Posts

I exported my online database as always through phpMyAdmin...

 

View dump (schema) of database -

Export: SQL

Options >

Structure:

Add IF NOT EXSIST

Add AUTO_INCREMENT value

Enclose table and field names with backquotes

Data:

Complete inserts

Extended inserts

Maximum length of created query 50000

Use hexidecimal for BLOB

 

Copied and pasted into Notepad.

Imported on my local phpMyAdmin as always.

 

Received this error:

 

Error

 

SQL query:

 

--

-- Dumping data for table `address_format`

--

INSERT INTO `address_format` ( `address_format_id` , `address_format` , `address_summary` )

VALUES ( 1, '$firstname $lastname$cr$streets$cr$city, $postcode$cr$statecomma$country', '$city / $country' ) , ( 2, '$firstname $lastname$cr$streets$cr$city, $state $postcode$cr$country', '$city, $state / $country' ) , ( 3, '$firstname $lastname$cr$streets$cr$city$cr$postcode - $statecomma$country', '$state / $country' ) , ( 4, '$firstname $lastname$cr$streets$cr$city ($postcode)$cr$country', '$postcode / $country' ) , ( 5, '$firstname $lastname$cr$streets$cr$postcode $city$cr$country', '$city / $country' ) ;

 

MySQL said:

 

#1062 - Duplicate entry '1' for key 1

 

I tried deleting all entries in the destination database address_format table and then received a similar error pointing to address_book. So I tried deleting data from both tables and then received a similar error for the 'banners' table.

 

Any ideas what is going on and what I should look for?

 

 

- :: Jim :: -

- My Toolbox ~ Adobe Web Bundle, XAMPP & WinMerge | Install ~ osC v2.3.3.4 -

Link to comment
Share on other sites

I have to check my database but the returned MySQL message said it was successful.

 

Instead of exporting as type - INSERT I tried UPDATE. DUH... blush.gif

 

It seems there was/is a bug within MySQL regarding INSERT / UPDATE / REPLACE.

 

You have to be specific.

 

Just thought I'd post in case anyone else ran into a similar problem and panic'ed like me. whistling.gif

- :: Jim :: -

- My Toolbox ~ Adobe Web Bundle, XAMPP & WinMerge | Install ~ osC v2.3.3.4 -

Link to comment
Share on other sites

Nope... UPDATE didn't work either. pinch.gif

 

REPLACE

 

WOW what an option to be stuck with. huh.gif

- :: Jim :: -

- My Toolbox ~ Adobe Web Bundle, XAMPP & WinMerge | Install ~ osC v2.3.3.4 -

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...