您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

MySQL之-查询指定的数据库和表是否存在

2024/2/26 0:34:16发布15次查看
1、查看指定的数据库是否存在
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之-查询指定的数据库和表是否存在的详细内容。
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product