Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Verify that SET FOREIGN KEY CHECKS is set to = 1

Tags:

mysql

I would like to DROP and create back the same table in using phpmyadmin.

DROP TABLE IF EXISTS `product_entity`;

CREATE TABLE `product_entity` ( ...... );

I get error message

Cannot delete or update a parent row: a foreign key constraint fails

Then I set

SET FOREIGN_KEY_CHECKS=0; 
DROP TABLE IF EXISTS `product_entity`;
SET FOREIGN_KEY_CHECKS=1;
CREATE TABLE `product_entity` ( ...... );

My question is how to verify that SET FOREIGN KEY CHECKS is set to = 1?

Thanks.

like image 876
Nano Avatar asked Jan 21 '14 10:01

Nano


1 Answers

Try this in console

SELECT @@foreign_key_checks;

See Demo

like image 71
M Khalid Junaid Avatar answered Oct 12 '22 13:10

M Khalid Junaid