1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
|
> docker exec -it myr /bin/bash
[root@e57a474552c5 /]# /usr/local/mysql/bin/mysql -h127.0.0.1
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.6.27 Source distribution
Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| test |
+--------------------+
4 rows in set (0.01 sec)
mysql> show engines;
+------------+---------+----------------------------------------------------------------+--------------+------+------------+
| Engine | Support | Comment | Transactions | XA | Savepoints |
+------------+---------+----------------------------------------------------------------+--------------+------+------------+
| ROCKSDB | DEFAULT | RocksDB storage engine | YES | YES | YES |
| MRG_MYISAM | YES | Collection of identical MyISAM tables | NO | NO | NO |
| MyISAM | YES | MyISAM storage engine | NO | NO | NO |
| BLACKHOLE | YES | /dev/null storage engine (anything you write to it disappears) | NO | NO | NO |
| CSV | YES | CSV storage engine | NO | NO | NO |
| MEMORY | YES | Hash based, stored in memory, useful for temporary tables | NO | NO | NO |
| ARCHIVE | YES | Archive storage engine | NO | NO | NO |
| FEDERATED | NO | Federated MySQL storage engine | NULL | NULL | NULL |
| InnoDB | NO | Supports transactions, row-level locking, and foreign keys | NULL | NULL | NULL |
+------------+---------+----------------------------------------------------------------+--------------+------+------------+
9 rows in set (0.00 sec)
mysql> CREATE TABLE `linktable` (
-> `id1` bigint(20) unsigned NOT NULL DEFAULT '0',
-> `id1_type` int(10) unsigned NOT NULL DEFAULT '0',
-> `id2` bigint(20) unsigned NOT NULL DEFAULT '0',
-> `id2_type` int(10) unsigned NOT NULL DEFAULT '0',
-> `link_type` bigint(20) unsigned NOT NULL DEFAULT '0',
-> `visibility` tinyint(3) NOT NULL DEFAULT '0',
-> `data` varchar(255) NOT NULL DEFAULT '',
-> `time` bigint(20) unsigned NOT NULL DEFAULT '0',
-> `version` int(11) unsigned NOT NULL DEFAULT '0',
-> PRIMARY KEY (link_type, `id1`,`id2`) COMMENT 'cf_link_pk',
-> KEY `id1_type` (`id1`,`link_type`,`visibility`,`time`,`version`,`data`) COMMENT 'rev:cf_link_id1_type'
-> ) ENGINE=RocksDB DEFAULT COLLATE=latin1_bin;
Query OK, 0 rows affected (0.02 sec)
mysql> show tables in test;
+----------------+
| Tables_in_test |
+----------------+
| linktable |
+----------------+
1 row in set (0.00 sec)
mysql> desc linktable;
+------------+---------------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+------------+---------------------+------+-----+---------+-------+
| id1 | bigint(20) unsigned | NO | PRI | 0 | |
| id1_type | int(10) unsigned | NO | | 0 | |
| id2 | bigint(20) unsigned | NO | PRI | 0 | |
| id2_type | int(10) unsigned | NO | | 0 | |
| link_type | bigint(20) unsigned | NO | PRI | 0 | |
| visibility | tinyint(3) | NO | | 0 | |
| data | varchar(255) | NO | | | |
| time | bigint(20) unsigned | NO | | 0 | |
| version | int(11) unsigned | NO | | 0 | |
+------------+---------------------+------+-----+---------+-------+
9 rows in set (0.01 sec)
|