![]() See §§ 14.2.2.5 "FOREIGN KEY Constraints" and 13.1.17.2 "Using FOREIGN KEY Constraints" in the MySQL 5.6 Reference Manual. But InnoDB doesn't support deferred checks, so it treats ON DELETE NO ACTION exactly the same as ON DELETE RESTRICT, and always rejects the DELETE immediately.) (Note: in some DBMSes, and in standard SQL, ON DELETE NO ACTION is a bit different from ON DELETE RESTRICT: in those, ON DELETE NO ACTION means "accept the DELETE within the current transaction, but reject the whole transaction if I try to commit it before rectifying the problem". ![]() So InnoDB can't fix the situation for you all it can do is reject the DELETE and return an error.Īs a result, ON DELETE NO ACTION is actually the same as ON DELETE RESTRICT (the default). It will reject any INSERT or UPDATE operation that attempts to create a foreign key value in a child table if there is no a matching candidate key value in the parent table. ![]() If you specify NO ACTION, you're telling InnoDB that you don't want it to take either of these actions. The FOREIGN KEY clause is specified in the child table. 1) Add in just beginning of database file SET FOREIGNKEYCHECKS 0 2) Just before end of file at last line of file. What we need to do is, edit that database file i.e. If you hard-delete a user, you might want the file's last-modified-by to become simply "unknown".) 3 Answers Sorted by: 4 Ya, we can set foreign key check as disable before importing database into phpmyadmin. (This might make sense for something like file.last_modified_by. Alternatively, you can also trigger sql query for the same. phpMyAdmin allows relationships (similar to foreign keys) using MySQL-native (InnoDB) methods when available and falling back on special phpMyAdmin-only.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |