Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要找出我的数据库设置中是否有任何类似的命名数据库 - 例如“BusApp”、“BusApp2”、“BusAppTrial”等。
我知道我可以执行“显示数据库”命令并检查输出。但我需要从 shell 文件中检查它。因此,我正在寻找一些 SQL,例如:
SELECT count(*) from information_schema.XXX where DBName like 'BusAp%'
谁能帮我?
提前致谢,
SELECT table_schema from information_schema.tables where table_schema like 'BusAp%' group by table_schema
SQLFiddle 演示
select count(*) from information_schema.schemata where schema_name like 'BusAp%'