MySQL Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesMySQL Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old August 9th, 2000, 04:38 PM
MarkO MarkO is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2000
Posts: 12 MarkO User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
What's the easiest way to find the total size for a database?

Thanks
MarkO

Reply With Quote
  #2  
Old August 10th, 2000, 04:06 AM
christucker2 christucker2 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2000
Posts: 81 christucker2 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 9
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.

Reply With Quote
  #3  
Old August 10th, 2000, 06:00 PM
sagar sagar is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2000
Location: Amsterdam
Posts: 1 sagar User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I know that in sybase you can check it with sp_helpdevice don't know if that works in mysql

Reply With Quote
  #4  
Old August 10th, 2000, 09:38 PM
MarkO MarkO is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2000
Posts: 12 MarkO User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Using du -h /usr/local/mysql/data/dbname gave me the exact info I was looking for.

Thanks
MarkO

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesMySQL Help > Database size??


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT