Does MySQL foreign_key_checks affect the entire database?

后端 未结 6 1183
南方客
南方客 2020-11-30 18:27

When I execute this command in MySQL:

SET FOREIGN_KEY_CHECKS=0;

Does it affect the whole engine or it is only my current transaction?

6条回答
  •  借酒劲吻你
    2020-11-30 19:17

    # will get you the current local (session based) state.
    SHOW Variables WHERE Variable_name='foreign_key_checks';
    

    If you didn't SET GLOBAL, only your session was affected.

提交回复
热议问题