|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
What's the easiest way to find the total size for a database?
Thanks MarkO |
|
#2
|
|||
|
|||
|
If you want to know the size in bytes (or kbytes, mbytes etc.) do something along the lines of:
du /usr/local/mysql/data (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. |
|
#3
|
|||
|
|||
|
I know that in sybase you can check it with sp_helpdevice don't know if that works in mysql
|
|
#4
|
|||
|
|||
|
Using du -h /usr/local/mysql/data/dbname gave me the exact info I was looking for.
Thanks MarkO |
![]() |
| Viewing: Dev Shed Forums > Databases > MySQL Help > Database size?? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|