470,866 Members | 1,930 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,866 developers. It's quick & easy.

Database size

How would I get the total size of a mysql database in MB format?

--
Sharif T. Karim
....you don't know wrath yet...
Jul 17 '05 #1
5 1760
On Mon, 19 Jul 2004 22:49:53 GMT, "Sharif T. Karim" <sh****@nyc.rr.com> wrote:
How would I get the total size of a mysql database in MB format?


Log on to the database server, find the data directory, and use "du -hs" on
the directory.

--
Andy Hassall <an**@andyh.co.uk> / Space: disk usage analysis tool
http://www.andyh.co.uk / http://www.andyhsoftware.co.uk/space
Jul 17 '05 #2
"Sharif T. Karim" wrote:
How would I get the total size of a mysql database in MB format?

http://www.webmasterworld.com/forum88/2069.htm

--
http://www.dbForumz.com/ This article was posted by author's request
Articles individually checked for conformance to usenet standards
Topic URL: http://www.dbForumz.com/PHP-Database...ict131072.html
Visit Topic URL to contact author (reg. req'd). Report abuse: http://www.dbForumz.com/eform.php?p=437579
Jul 17 '05 #3
"steve" wrote:
[quote:0f06a43aa5="Sharif T. Karim"]How would I get the total size of a mysql database in MB format?

http://www.webmasterworld.com/forum88/2069.htm[/quote:0f06a43aa5]

Sorry, the above URL is password protected.
Here’s how to do it from php.
do a mysql "show table status"
which produces a number of columns including "data_lenght" and
"index_lenght". Simply add these two number and furthere add them
for all the return records (i.e. tables), and you get the db size.

--
http://www.dbForumz.com/ This article was posted by author's request
Articles individually checked for conformance to usenet standards
Topic URL: http://www.dbForumz.com/PHP-Database...ict131072.html
Visit Topic URL to contact author (reg. req'd). Report abuse: http://www.dbForumz.com/eform.php?p=437580
Jul 17 '05 #4
steve, being the foo steve is, wrote:
"steve" wrote:
> [quote:0f06a43aa5="Sharif T. Karim"]How would I get the total

size of
> a mysql database in MB format?
>

http://www.webmasterworld.com/forum88/2069.htm[/quote:0f06a43aa5]

Sorry, the above URL is password protected.
Here's how to do it from php.
do a mysql "show table status"
which produces a number of columns including "data_lenght" and
"index_lenght". Simply add these two number and furthere add them
for all the return records (i.e. tables), and you get the db size.


Would I have to do a loop to get the total? Or just those array variables
will have the total together?

--
Sharif T. Karim
....you don't know wrath yet...
Jul 17 '05 #5
"Sharif T. Karim" wrote:
steve, being the foo steve is, wrote:
"steve" wrote:
> [quote:0f06a43aa5="Sharif T. Karim"]How would I get the
total size of
> a mysql database in MB format?
> http://www.webmasterworld.com/forum88/2069.htm


Sorry, the above URL is password protected.
Here’s how to do it from php.
do a mysql "show table status"
which produces a number of columns including "data_lenght" and
"index_lenght". Simply add these two number and furthere add

them for all the return records (i.e. tables), and you get the db size.


Would I have to do a loop to get the total? Or just those array
variables
will have the total together?
[/quote:16866fe06a]

Sharif, each row of the result set would have two values that you
need: the index size, and the data size. Each row pertains to a
single table.

So you have to loop thru all the returned rows, and add these numbers
up to get the total size of the database.
Here is another page, just copy the code!
http://www.pro.hioxindia.com/tutorials/DBsize.php

--
http://www.dbForumz.com/ This article was posted by author's request
Articles individually checked for conformance to usenet standards
Topic URL: http://www.dbForumz.com/PHP-Database...ict131072.html
Visit Topic URL to contact author (reg. req'd). Report abuse: http://www.dbForumz.com/eform.php?p=440087
Jul 17 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Kums | last post: by
9 posts views Thread by Pam Ammond | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.