Query to count the number of tables I have in MySQL

Genadinik picture Genadinik · Mar 5, 2011 · Viewed 191.8k times · Source

I am growing the number of tables I have and I am sometimes curious just to do a quick command line query to count the number of tables in my database. Is that possible? If so, what is the query?

Answer

Joseadrian picture Joseadrian · Mar 5, 2011
SELECT COUNT(*) FROM information_schema.tables WHERE table_schema = 'dbName';

Source

This is mine:

USE databasename; 
SHOW TABLES; 
SELECT FOUND_ROWS();