Magento SQLSTATE [23000]: Violation of integrity constraint: 1062 Duplicate record '363624' for key 'PRIMARY'

I transferred the mgento installation by doing the following:

  • copy all files
  • exported db
  • imported db using mysql workbench
  • changed base_url to a new domain
  • updated local.xml for correct settings

now im getting:

SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '363624' for key 'PRIMARY'

I searched for db for this key 363624, but it is not duplicated, as the messages say

how can i solve this?

+6
source share
7 answers

This is not duplicated, but something should try to duplicate.

? , SQL " SET FOREIGN_KEY_CHECKS = 0;" .

, :

SET FOREIGN_KEY_CHECKS = 0;

... :

SET FOREIGN_KEY_CHECKS = 1;

... .

+8

( ):

Magento SQL-:

TRUNCATE dataflow_batch_export ; 
TRUNCATE dataflow_batch_import ; 
TRUNCATE log_customer ; 
TRUNCATE log_quote ; 
TRUNCATE log_summary ; 
TRUNCATE log_summary_type ; 
TRUNCATE log_url ; 
TRUNCATE log_url_info ; 
TRUNCATE log_visitor ; 
TRUNCATE log_visitor_info ; 
TRUNCATE log_visitor_online ; 
TRUNCATE report_event ;

var/session dir ( ), , .

+30

.

, , "", .

, "log_visitor_info" 100 , , , .

100 , . , , f5, , Magento .

, .

+6

UTF-8 . UTF-8 BOM, .

0

, 'cataloginventory_stock_item' having 'UNQ_CATALOGINVENTORY_STOCK_ITEM_PRODUCT_ID_STOCK_ID' index,

, , , SKU script.

0

sql- magento.

TRUNCATE dataflow_batch_export ;

TRUNCATE dataflow_batch_import ; 

TRUNCATE log_customer ; 

TRUNCATE log_quote ; 

TRUNCATE log_summary ; 

TRUNCATE log_summary_type ; 

TRUNCATE log_url ; 

TRUNCATE log_url_info ; 

TRUNCATE log_visitor ; 

TRUNCATE log_visitor_info ; 

TRUNCATE log_visitor_online ; 

TRUNCATE report_event ;

"log_visitor_info". "visitor_id" null. -, . , .

ALTER TABLE `log_visitor_info` CHANGE `visitor_id` `visitor_id` BIGINT(20) UNSIGNED NOT NULL COMMENT 'Visitor ID';
0

log_visitor_info , log_visitor_info , log_visitor, @creuzerm;

,

SELECT MAX('visitor_id') FROM 'log_visitor';

SELECT MAX('visitor_id') FROM 'log_visitor_info';

,

DELETE FROM 'log_visitor_info' WHERE 'visitor_id' > ( SELECT MAX('visitor_id') FROM 'log_visitor' );

DELETE FROM 'log_visitor_online' WHERE 'visitor_id' > ( SELECT MAX('visitor_id') FROM 'log_visitor' );
0

All Articles