---
title: "Mysql查询某database的所有表的记录数"
author: "小网客"
date: "2018-11-28T18:05:29Z"
tags: []
categories: ["数据库"]
slug: "mysql-database"
draft: false
lastmod: "2018-11-28T18:05:29Z"
id: 2434454
url: "https://snv.iteye.com/blog/2434454"
---

需求：

查询某固定db中所有表的记录数，然后排序

实现：

select table\_name,table\_rows from information\_schema.tables  where table\_schema='yourdb' order by table\_rows desc;