SHOW
SHOW
关键字提供数据库和表信息。
SHOW DATABASES
展示所有数据库:
SHOW [FULL] DATABASES;
+---------+
| Schemas |
+---------+
| public |
+---------+
1 row in set (0.01 sec)
展示名称符合 LIKE
模式的数据库:
SHOW DATABASES LIKE 'p%';
根据 where
表达式展示数据库:
SHOW DATABASES WHERE Schemas='test_public_schema';
展示所有数据库,包括它们的选项:
create database with(ttl='7d');
SHOW FULL DATABASES;
+--------------------+-------------+
| Database | Options |
+--------------------+-------------+
| greptime_private | |
| information_schema | |
| public | |
| test | ttl='7days' |
+--------------------+-------------+