MySQL: Count number of tables in database

August 18, 2016

If you need to count the number of tables that exist in a MySQL database you can do so with the following query. Just remember to swap out the database name!

SELECT count(*) 
FROM information_schema.tables 
WHERE table_schema = 'YOUR_DB_NAME'
Leave a Reply

Your email address will not be published. Required fields are marked *