SET_FOREIGN_KEY = 0 or 1 not WorK
See original GitHub issuewhen I have a table without an external key, just one drop table for delete table but if have constraint and use SET foreign_key_checks = 0;
after of the query not work… error is
Cannot delete or update a parent row: a foreign key constraint fails
please help me I do not want to change package I’m fine with this
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
'SET foreign_key_checks = 1' does not work again
It turns out that any rows you modified after “SET foreign_key_checks = 0;” will not be checked in the future, even after “SET...
Read more >MySQL - Check or Not Foreign Key Constraints - SQLines
Syntax, SET FOREIGN_KEY_CHECKS = 0 | 1 ; Default, 1, Foreign keys are checked ; When Set to 1, Existing data are not...
Read more >how to set foreign key - Vertabelo SA
1. Click on the reference. 2. Select PK column and FK column 3 Click "Add". ... I did not want to column name...
Read more >how to set foreign key check to zero - Laracasts
So first you have to drop pivot tables or ones that have CONSTRAINTS and then main table. Example: Copy Code public function up()...
Read more >how to SET FOREIGN_KEY_CHECKS = 0 in phpMyAdmin
I am trying to truncate some mySQL tables from phpMyAdmin web interface, but for foreign keys constraint I am not able to do...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Are you trying to disable foreign key checks so that it allows you to delete data? If so, I believe the command is:
SET foreign_key_checks = 0;
When you want to enable it again, it is simply:
SET foreign_key_checks = 1;
Hope this helps.
I’m going to close this since it’s been lingering waiting for OP.