applex 2020-07-26
SHOW DATABASES [LIKE ‘数据库名‘];
语法说明如下:
‘ ‘
包围。示例1:
mysql> SHOW DATABASES; +--------------------+ | Database | +--------------------+ | information_schema | | mysql | | performance_schema | | sakila | | sys | | world | +--------------------+ 6 row in set (0.22 sec)
示例2:使用like语句(模糊查询)
mysql> SHOW DATABASES LIKE ‘%test%‘; +--------------------+ | Database (%test%) | +--------------------+ | db_test | +--------------------+ | db_test_db | +--------------------+ | test_db | +--------------------+ 3 row in set (0.03 sec)