August 9th, 2000, 04:38 PM
What's the easiest way to find the total size for a database?
August 10th, 2000, 04:06 AM
If you want to know the size in bytes (or kbytes, mbytes etc.) do something along the lines of:
(where /usr/local/mysql/data is the path to your data files for the database).
If you want to know how many rows are in a table, do:
select count(*) from table;
If you want to know how many tables there are, type show tables; and count the number of results (or run it through some application logic to do that for you). This is one of my gripes with MySQL - it treats meta data about certain things (tables, databases in particular) differently to the rest of the information in the DB. I much prefer the Oracle approach of storing all that info in relational tables so all your standard SQL commands work on it.
August 10th, 2000, 06:00 PM
I know that in sybase you can check it with sp_helpdevice don't know if that works in mysql
August 10th, 2000, 09:38 PM
Using du -h /usr/local/mysql/data/dbname gave me the exact info I was looking for.