Tag Archive general error

SQL General error – 1553 Cannot drop index XYZ needed in a foreign key constraint

9. Februar 2016 Kommentare deaktiviert für SQL General error – 1553 Cannot drop index XYZ needed in a foreign key constraint By webpirat
// show indexes of table
SHOW CREATE TABLE news;

// shows something like this
...
CONSTRAINT `FK_3A51546D12469DE2` FOREIGN KEY (`category_id`) REFERENCES `news_category` (`id`),
...

// drop index
ALTER TABLE news DROP FOREIGN KEY FK_3A51546D12469DE2;

, , , , , , ,