Actually, there are two foreign_key_checks
variables: a global variable and a local (per session) variable. Upon connection, the session variable is initialized to the value of the global variable.
The command SET foreign_key_checks
modifies the session variable.
To modify the global variable, use SET GLOBAL foreign_key_checks
or SET @@global.foreign_key_checks
.
Consult the following manual sections:
http://dev.mysql.com/doc/refman/5.7/en/using-system-variables.html
http://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html