List of non-empty tables in MySQL database

前端 未结 4 1958
北海茫月
北海茫月 2020-12-12 21:23

Can I get MySQL to return all non-empty tables in a database? Much like \"SHOW TABLES\" but only those that are not empty.

4条回答
  •  遥遥无期
    2020-12-12 21:40

    You can run this query via phpMyAdmin:

    SELECT * 
    FROM  `information_schema`.`TABLES` 
    WHERE  `TABLE_ROWS` > 0
    

    will return a list of non-empty tables

提交回复
热议问题