sql >> Databasteknik >  >> RDS >> Mysql

Kontrollera aktuellt FOREIGN_KEY_CHECKS-värde

Kontrollera 5.1.5 Serversystemvariabler::utländska_nyckelkontroller :

mysql> SELECT @@GLOBAL.foreign_key_checks, @@SESSION.foreign_key_checks;
+-----------------------------+------------------------------+
| @@GLOBAL.foreign_key_checks | @@SESSION.foreign_key_checks |
+-----------------------------+------------------------------+
|                           1 |                            1 |
+-----------------------------+------------------------------+
1 row in set (0.01 sec)

UPPDATERA

mysql> SELECT VERSION();
+-----------+
| VERSION() |
+-----------+
| 5.7.18    |
+-----------+
1 row in set (0.00 sec)

mysql> SELECT IF((SELECT `VARIABLE_VALUE`
    -> FROM `performance_schema`.`global_variables`
    -> WHERE `VARIABLE_NAME` = 'foreign_key_checks') = 'ON', 1, 0) `global.foreign_key_checks`,
    -> IF((SELECT `VARIABLE_VALUE`
    -> FROM `performance_schema`.`session_variables`
    -> WHERE `VARIABLE_NAME` = 'foreign_key_checks') = 'ON', 1, 0) `session.foreign_key_checks`;
+---------------------------+----------------------------+
| global.foreign_key_checks | session.foreign_key_checks |
+---------------------------+----------------------------+
|                         1 |                          1 |
+---------------------------+----------------------------+
1 row in set (0.00 sec)



  1. MySQL Basic Database Administration Commands – Del I

  2. Prestanda överraskningar och antaganden:DATEADD

  3. Så här gör du:Grails 3.0.2 + Oracle Database 12c?

  4. Värdet 'CONTINUE' är inte ett facettgiltigt fel vid körning av liquibase