select information_schema.schemata.schema_name from information_schema.schemata where schema_name='databasename';
2、查看指定的数据库下是否存在某张表
select distinct t.table_name, n.schema_name from information_schema.tables t, information_schema.schemata n where t.
table_name = 'tablename' and n.schema_name = 'databasename';
以上就是mysql之-查询指定的数据库和表是否存在的详细内容。
