Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [MySQL] Cannot truncate a table referenced in a foreign key constraint
Agape
post 4.05.2016, 08:57:07
Post #1





Grupa: Zarejestrowani
Postów: 384
Pomógł: 13
Dołączył: 16.06.2006

Ostrzeżenie: (0%)
-----


Mam problem z tabela tagow w magento, zle sie wgrala i teraz nie moge jej wyczycic:

Cytat
#1701 - Cannot truncate a table referenced in a foreign key constraint (`mag_us01`.`tag_properties`, CONSTRAINT `FK_TAG_PROPERTIES_TAG_ID_TAG_TAG_ID` FOREIGN KEY (`tag_id`) REFERENCES `mag_us01`.`tag` (`tag_id`))


nie moge wyczyscic tej bazy, probowalem
Cytat
SET FOREIGN_KEY_CHECKS=0;

ale nic nie dalo ...


--------------------
Go to the top of the page
+Quote Post
rad11
post 4.05.2016, 09:02:14
Post #2





Grupa: Zarejestrowani
Postów: 1 270
Pomógł: 184
Dołączył: 7.10.2012
Skąd: Warszawa

Ostrzeżenie: (0%)
-----


W ten sposób?

  1. SET FOREIGN_KEY_CHECKS=0;
  2. TRUNCATE table1;
  3. TRUNCATE table2;
  4. SET FOREIGN_KEY_CHECKS=1;
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 23.04.2024 - 14:21