我们可以使用哪些 MySQL 查询来查看 MySQL 数据库列表?
借助以下 MySQL 查询,我们可以查看 MySQL 数据库列表 −
mysql> SELECT schema_name FROM information_schema.schemata; +--------------------+ | schema_name | +--------------------+ | information_schema | | gaurav | | mysql | | performance_schema | | query | | query1 | | sys | | tutorials | +--------------------+ 8 rows in set (0.00 sec)
我们还可以将 WHERE 子句与以下查询一起使用 −
mysql> SELECT schema_name FROM information_schema.schemata WHERE schema_name LIKE '%schema' OR schema_name LIKE '%s'; +--------------------+ | schema_name | +--------------------+ | information_schema | | performance_schema | | sys | | tutorials | +--------------------+ 4 rows in set (0.00 sec)
广告