MySQL Forums
Forum List  »  Italian

[MySql] Ripristino database errore foreign keys
Posted by: Alessandro Antonutti
Date: May 29, 2013 07:02AM

Ho un database MySql di cui effettuo 2 backup giornalieri tramite uno script PHP usando mysqldump.

Quando tento il ripristino (in più volte in quanto scade lo script PHP) mi compare l'errore su foreign key mancanti (nella tabella sono presenti delle chiavi esterne presenti in tabelle che sequenzialmente vengono dopo).

#1452 - Cannot add or update a child row: a foreign key constraint fails

Seguendo altre guide trovate su internet ho provato anche a disabilitare il controllo sulle foreign key ma l'effetto non si è visto in quanto l'errore ricompare lo stesso.

Ecco i comandi che ho provato in sequenza:

SET autocommit=0;
SET unique_checks=0;
SET foreign_key_checks=0;

Poi avrei fatto il COMMIT una volta completato il ripristino. Ho anche provato solo il terzo comando da solo ma l'errore si ripresenta comunque.

Come posso ripristinare allora?

grazie
ciao

Options: ReplyQuote


Subject
Views
Written By
Posted
[MySql] Ripristino database errore foreign keys
1893
May 29, 2013 07:02AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.