Less Than Dot is a community of passionate IT professionals and enthusiasts dedicated to sharing technical knowledge, experience, and assistance. Inside you will find reference materials, interesting technical discussions, and expert tips and commentary. Once you register for an account you will have immediate access to the forums and all past articles and commentaries.
List All The Tables In Your MySQL Database
From Wiki
Sometimes you want to quickly see all the tables in your MySQL database. How can you do this? You can use the ANSI SQL Information Schema views to do this
To list all tables run the query below
- SELECT *
- FROM INFORMATION_SCHEMA.TABLES
- WHERE TABLE_TYPE = 'BASE TABLE';
To list all non system views run the query below
- SELECT *
- FROM INFORMATION_SCHEMA.TABLES
- WHERE TABLE_TYPE = 'VIEW';
To list all system views run the query below
- SELECT *
- FROM INFORMATION_SCHEMA.TABLES
- WHERE TABLE_TYPE = 'SYSTEM VIEW';
To get a count of all the tables and views broken down by table, view and system view run this
- SELECT COUNT(*),TABLE_TYPE
- FROM INFORMATION_SCHEMA.TABLES
- GROUP BY TABLE_TYPE;
Contributed By --SQLDenis 14:56, 3 September 2008 (GMT)



LTD Social Sitings
Note: Watch for social icons on posts by your favorite authors to follow their postings on these and other social sites.