mysql怎样查询表的个数

来源:这里教程网 时间:2026-02-28 15:23:44 作者:

本教程操作环境:windows10系统、mysql8.0.22版本、Dell G3电脑。

mysql怎样查询表的个数

查看数据库表数量

语法如下:

SELECT count(TABLE_NAME) FROM information_schema.TABLES WHERE TABLE_SCHEMA='dbname';

其中dbname是要查看的数据库的名字。

查看表结构:

description tbname;

也可使用简写:

desc tbname;

示例如下:

select count(*) tables ,table_schema from information_schema.tables where table_schema='work_ad' group by table_schema;

06.png

推荐学习:mysql视频教程

相关推荐