Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save yoku0825/9c96ee0f1b2e2dee23d8abc411603dec to your computer and use it in GitHub Desktop.
Save yoku0825/9c96ee0f1b2e2dee23d8abc411603dec to your computer and use it in GitHub Desktop.
$ mysql -h172.17.0.2 -vve "SELECT @@version; DROP DATABASE IF EXISTS d1;CREATE DATABASE d1; CREATE TABLE d1.t1 (num int, KEY(num)); CREAT
E TABLE d1.t2 (num int, KEY(num), FOREIGN KEY (num) REFERENCES t1(num)); DROP DATABASE d1;"
--------------
SELECT @@version
--------------
+-----------+
| @@version |
+-----------+
| 8.3.0 |
+-----------+
1 row in set (0.00 sec)
--------------
DROP DATABASE IF EXISTS d1
--------------
Query OK, 0 rows affected, 1 warning (0.00 sec)
--------------
CREATE DATABASE d1
--------------
Query OK, 1 row affected (0.01 sec)
--------------
CREATE TABLE d1.t1 (num int, KEY(num))
--------------
Query OK, 0 rows affected (0.01 sec)
--------------
CREATE TABLE d1.t2 (num int, KEY(num), FOREIGN KEY (num) REFERENCES t1(num))
--------------
Query OK, 0 rows affected (0.02 sec)
--------------
DROP DATABASE d1
--------------
Query OK, 2 rows affected (0.02 sec)
Bye
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment