Buy All 52 Premium WordPress Themes for $59.99
No Additional Fees, Pay Once and Use Unlimited Time for Unlimited Domains, Free Lifetime Updates

Get Total Count of Tables per Database in MySQL

Since most hosting providers restrict the number of tables per database, it’s a good idea to check the total number of tables to avoid hitting the quota. Here is how it can be done if you use MySQL:

Login to your Hosting Admin Panel and open phpMyAdmin or other tool allowing you to handle the administration of MySQL and executing custom SQL queries over your databases.

Then execute the following SQL script:

select table_schema as 'database',
    count(*) as 'tables'
from information_schema.tables
where table_type = 'BASE TABLE'
group by table_schema;

It will return a table with 2 columns: database names and number of tables per each.

Leave a Reply