Mostra notizie nelle discussioni
Avatar
☺
Scritto da
::1
il 2014-02-24 20:27:34.0 alle 2014-02-24 20:27:34.0
Trollate totali: 12321
mysql e foreign key
$ mysql -u root
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 6
Server version: 5.5.35-MariaDB-log MariaDB Server

Copyright (c) 2000, 2013, Oracle, Monty Program Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> CREATE DATABASE testdb;
Query OK, 1 row affected (0.00 sec)

MariaDB [(none)]> USE testdb;
Database changed
MariaDB [testdb]> CREATE TABLE TBL1 (id INT(1) PRIMARY KEY) ENGINE=InnoDB DEFAULT CHARSET=utf8;
Query OK, 0 rows affected (0.01 sec)

MariaDB [testdb]> CREATE TABLE TBL2 (id2 INT(1) REFERENCES TBL1 (id)) ENGINE=InnoDB DEFAULT CHARSET=utf8;
Query OK, 0 rows affected (0.01 sec)

MariaDB [testdb]> INSERT INTO TBL2 VALUES (1);
Query OK, 1 row affected (0.00 sec)

MariaDB [testdb]> DROP TABLE TBL1;
Query OK, 0 rows affected (0.00 sec)

MariaDB [testdb]> DROP TABLE TBL2;
Query OK, 0 rows affected (0.00 sec)

MariaDB [testdb]> DROP DATABASE testdb;
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> Bye


wat? che mi sono perso? perché non controlla le foreign key?
Installazione di default di mariadb 5.5, sia su windows che su archlinux.
Young professional woman and busy mom.

Pagina generata in 36 millisecondi

Utenti attivi: 9 nell'ultimo minuto, 24 negli ultimi cinque minuti, 43 negli ultimi 15 minuti