Mysql
 sql >> Teknologi Basis Data >  >> RDS >> Mysql

Periksa nilai FOREIGN_KEY_CHECKS saat ini

Periksa 5.1.5 Variabel Sistem Server::foreign_key_checks :

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)

PERBARUI

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. Database
  2.   
  3. Mysql
  4.   
  5. Oracle
  6.   
  7. Sqlserver
  8.   
  9. PostgreSQL
  10.   
  11. Access
  12.   
  13. SQLite
  14.   
  15. MariaDB
  1. Menjalankan prosedur tersimpan dengan kursor di PHP

  2. Hubungkan ke mysql jarak jauh melalui terminal

  3. Kesalahan nilai negatif dalam klausa batas

  4. MySQL memilih entri tertentu dari tabel yang tidak ada di tabel lain

  5. Kesalahan fatal:Panggilan ke fungsi anggota execute() di boolean