Error Code 1217
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers foreign key constraint fails mysql or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x error 1217 cannot delete Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it drop table with foreign key mysql only takes a minute: Sign up Bogus foreign key constraint fail up vote 95 down vote favorite 39 I get this error message: ERROR 1217 (23000) at line 40: Cannot delete or update a parent row: a foreign key constraint
Set Foreign_key_checks 0
fails ... when I try to drop a table: DROP TABLE IF EXISTS `area`; ... defined like this: CREATE TABLE `area` ( `area_id` char(3) COLLATE utf8_spanish_ci NOT NULL, `nombre_area` varchar(30) COLLATE utf8_spanish_ci NOT NULL, `descripcion_area` varchar(100) COLLATE utf8_spanish_ci NOT NULL, PRIMARY KEY (`area_id`), UNIQUE KEY `nombre_area_UNIQUE` (`nombre_area`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci; The funny thing is that I already dropped all other tables in the schema that have foreign keys against area. Actually, the database is empty except for the mysql foreign key constraint area table. How can it possibly have child rows if there isn't any other object in the database? As far as I know, InnoDB doesn't allow foreign keys on other schemas, does it? (I can even run a RENAME TABLE area TO something_else command :-?) mysql innodb share|improve this question edited Jan 18 at 15:02 asked Jul 26 '10 at 12:06 Álvaro González 80.7k20133198 Is it possible that the table is a part of a Referential-Integrity relationship in another schema? –Raj More Jul 26 '10 at 12:21 I have some other copies of the app so it's always possible. However, the syntax I use is basically CONSTRAINT fk_servicio_area1 FOREIGN KEY (area_id) REFERENCES area (area_id), i.e., no schema name on the table reference :-? –Álvaro González Jul 26 '10 at 12:38 add a comment| 9 Answers 9 active oldest votes up vote 85 down vote accepted Two possibilities: There is a table within another schema ("database" in mysql terminology) which has a FK reference The innodb internal data dictionary is out of sync with the mysql one. You can see which table it was (one of them, anyway) by doing a "SHOW ENGINE INNODB STATUS" after the drop fails. If it turns out to be the latter case, I'd dump and restore the whole server if you can. MySQL 5.1 and above will give you the name of the table with the FK in the error
here for a quick overview of the site Help Center Detailed answers to any questions you might mysql drop foreign key have Meta Discuss the workings and policies of this site
Cannot Add Or Update A Child Row: A Foreign Key Constraint Fails
About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting
Errno 150 Foreign Key Constraint Is Incorrectly Formed
ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 http://stackoverflow.com/questions/3334619/bogus-foreign-key-constraint-fail million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Error code 1217 in MySQL code [duplicate] up vote 0 down vote favorite This question already has an answer here: Bogus foreign key constraint fail 9 answers I'm getting the error: Error 1217 in my MySQL code. My http://stackoverflow.com/questions/36629400/error-code-1217-in-mysql-code MySQL code is DROP TABLE IF EXISTS Formed; DROP TABLE IF EXISTS Album; DROP TABLE IF EXISTS Band; DROP TABLE IF EXISTS Customers; DROP TABLE IF EXISTS Track; CREATE TABLE Formed( FormedID int AUTO_INCREMENT, YearFormed int, CountryFormed varchar(50), CityFormed varchar(50), BandMembers varchar(400), PRIMARY KEY(FormedID)) ENGINE=InnoDB; CREATE TABLE Track ( TrackID int AUTO_INCREMENT, AlbumID int AUTO_INCREMENT, Songs varchar (100), TrackNumber varchar (20), Title varchar (30), TrackDuration varchar (4), PRIMARY KEY (TrackID)) ENGINE=InnoDB; CREATE TABLE Album( AlbumID int AUTO_INCREMENT, TrackID int AUTO_INCREMENT, BandID int AUTO_INCREMENT, KEY(TrackID), KEY(BandID), Price varchar(5), PublicationDate varchar(11), Title varchar(30), Genre varchar (36), PRIMARY KEY(AlbumID)) ENGINE=InnoDB; CREATE TABLE Band( BandID int AUTO_INCREMENT, AlbumID int AUTO_INCREMENT, KEY(AlbumID), RecordLabel varchar(50), PRIMARY KEY(BandID)) ENGINE=InnoDB; CREATE TABLE Customers ( CustomerID int AUTO_INCREMENT, CName varchar (20), CPhone int (11), CEmail varchar (50), CPPaid varchar (50), CPDate date, PRIMARY KEY (CustomerID)) ENGINE=InnoDB; ALTER TABLE Track ADD FOREIGN KEY (AlbumID) REFERENCES Album(AlbumID)ON DELETE SET NULL ON UPDATE CASCADE; ALTER TABLE Album ADD FOREIGN KEY (TrackID) REFERENCES Track(TrackID)ON DE
Level:3/3 | Add Comment http://www.autocodes.com/p1217_nissan.html Forum Code Possible causes - Faulty Thermostat- Faulty cooling fan motor- Cooling fan harness is http://www.autocodes.com/p1217_nissan.html open or shorted- Cooling fan circuit poor electrical connection- Engine Control Module (ECM) http://www.cleanwindowserrors.com/1217.php Program - Leaking radiator hose - Leaking or clogged radiator- Radiator cap - Leaking or damage Water pump What does this mean? Tech notes The coolant system thermostat it's the most likely cause of the P1217 code. What does this mean? When is the code detected?- Cooling fan does foreign key not operate properly (Overheat) - Cooling fan system does not operate properly (Overheat) - Engine coolant was not added to the system using the proper filling method- Engine coolant is not within the specified range. Possible symptoms- Engine Light ON (or Service Engine Soon Warning Light)- Engine overheating P1217 Nissan Description The Engine Control Module (ECM) controls the cooling fan corresponding to the vehicle foreign key constraint speed, engine coolant temperature, refrigerant pressure, and air conditioner ON signal. The control system has 3-step control [HIGH/LOW/OFF]. If the cooling fan or another component in the cooling system malfunctions, engine coolant temperature will rise. When the engine coolant temperature reaches an abnormally high temperature condition, a malfunction is indicated. P1217 Nissan Information for specific Nissan models P1217 2002 NISSAN ALTIMA SEDAN P1217 2003 NISSAN ALTIMA SEDAN P1217 2004 NISSAN ALTIMA SEDAN P1217 2005 NISSAN ALTIMA SEDAN P1217 2006 NISSAN ALTIMA SEDAN P1217 2008 NISSAN ALTIMA SEDAN P1217 2009 NISSAN ALTIMA SEDAN P1217 2010 NISSAN ALTIMA SEDAN P1217 2011 NISSAN ALTIMA SEDAN P1217 2012 NISSAN ALTIMA SEDAN P1217 2004 NISSAN MAXIMA P1217 2005 NISSAN MAXIMA P1217 2006 NISSAN MAXIMA P1217 2007 NISSAN MAXIMA P1217 2008 NISSAN MAXIMA P1217 2005 NISSAN PATHFINDER P1217 2006 NISSAN PATHFINDER P1217 2007 NISSAN PATHFINDER P1217 2008 NISSAN PATHFINDER P1217 2009 NISSAN PATHFINDER P1217 2010 NISSAN PATHFINDER P1217 2011 NISSAN PATHFINDER P1217 2012 NISSAN PATHFINDER P1217 2008 NISSAN ROGUE P1217 2009 NISSAN ROGUE P1217 2010 NISSAN ROGUE P1217 2011 NISSAN ROGUE P1217 2012 N
Windows Error Code 1217 Windows error code 1217 can be shortened in only two words: driver problem. It is unknown device code. This error code 1217 is an explicit to the windows device manger and is a clear indicator that there are errors with the driver to the wrong device. The windows error code 1217 is generally generated due to errors reported by the driver itself meaning that this error is a software problem or compatibility issues between the hardware installed and the system being used. And it is very common and it is occurs when the operating system and the drivers installed are not companionable with each other. This windows error prompts on your PC screen with some error message in the dialog box. They are: "Windows has stopped this device because it has reported problems. (Code 1217)" Above error are appears on your system when windows first boots and will stop various application form running as well as preventing your computer from being able to run as smoothly as it should. And also when you are trying to play or use programs that is graphics intensive or when you are trying to connect a USB device to your computer and you keep getting an error 1217. After then the operating system and the hardware installed on the system are not able to communicate and the process has to be terminated, and this windows error code common in windows operating system such as windows xp, vista and windows 7 and hardware is damaged. Unknown device code problem can appear so unexpectedly, or they are due to many causes such as outdated or old device drivers, corrupt or damaged device drivers, wrong entries in registry, virus attacks, malware or spyware infectious, driver is not installed, a previous attempt to update the driver failed, the device is damaged, the device is not plugged in correctly or all the way and driver i