21. SCHEMATA
在MySQL中,SCHEMA是数据库,因此SCHEMATA表
提供有关数据库的信息。
SCHEMATA表
有以下列:
- CATALOG_NAME :SCHEMA所属目录的名称。该值始终为def。
- SCHEMA_NAME :SCHEMA名称
- DEFAULT_CHARACTER_SET_NAME:SCHEMA默认字符集
- DEFAULT_COLLATION_NAME :SCHEMA字符集排序规则
- SQL_PATH :此值始终为NULL。
示例
mysql> SELECT SCHEMA_NAME AS `Database`
FROM INFORMATION_SCHEMA.SCHEMATA;
+--------------------+
| Database |
+--------------------+
| information_schema |
| move_db |
| mysql |
| mysql3306_data |
| performance_schema |
| sys |
| test |
| undolog |
+--------------------+
8 rows in set (0.00 sec)
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| move_db |
| mysql |
| mysql3306_data |
| performance_schema |
| sys |
| test |
| undolog |
+--------------------+
8 rows in set (0.00 sec)