MySQL 9.0 发行说明
给定一个架构名称,此过程创建一个同义词架构,其中包含引用原始架构中所有表和视图的视图。例如,这可以用于创建一个简短的名称来引用一个具有长名称的架构(例如,info
而不是 INFORMATION_SCHEMA
)。
mysql> SHOW DATABASES;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| sys |
| world |
+--------------------+
mysql> CALL sys.create_synonym_db('INFORMATION_SCHEMA', 'info');
+---------------------------------------+
| summary |
+---------------------------------------+
| Created 63 views in the info database |
+---------------------------------------+
mysql> SHOW DATABASES;
+--------------------+
| Database |
+--------------------+
| information_schema |
| info |
| mysql |
| performance_schema |
| sys |
| world |
+--------------------+
mysql> SHOW FULL TABLES FROM info;
+---------------------------------------+------------+
| Tables_in_info | Table_type |
+---------------------------------------+------------+
| character_sets | VIEW |
| collation_character_set_applicability | VIEW |
| collations | VIEW |
| column_privileges | VIEW |
| columns | VIEW |
...