473,387 Members | 1,890 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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 1950
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Marvin Libson | last post by:
Hi All: I am running DB2 UDB V7.2 with FP11. Platform is Windows 2000. I have created a java UDF and trigger. When I update my database I get the following error: SQL1224N A database...
2
by: Kums | last post by:
What is the maximum permissible size of a database? Is there any limitation. What is the maximum # of tablespace's allowed in a database? Thanks for your response.
0
by: ImraneA | last post by:
Hi there Many thanks to those people who contributed to this group, helped me greatly. Enclose, my code, hope it helps others :- Public Function Export_Excel_9(tbx1 As Variant, tbx2 As...
9
by: Pam Ammond | last post by:
I need the code to update the database when Save is clicked and a text field has changed. This should be very easy since I used Microsoft's wizards for the OleDBAdapter and OleDBConnection, and...
0
bartonc
by: bartonc | last post by:
#Boa:Dialog:DBConnectDialog import wx ##"""Given a set if login specs, create a dbServer instance and ## ensure that there is a valid, open connection to the database. ## If not, set the...
4
by: vijay.db | last post by:
Hi Group, It's really confusing to calculate the size of the DB2 UDB database in versions lesser than 8.2. In Version 8.2 if we run the query db2 "call get_dbsize_info(?,?,?,0)" it gives us...
0
by: narayan2586 | last post by:
Hi all, When ever i am trying to connect my application it's giving below error message: RemoteException occurred in server thread; nested exception is: java.rmi.RemoteException: ; nested...
2
by: rustyc | last post by:
Well, here's my first post in this forum (other than saying 'HI' over in the hi forum ;-) As I said over there: ... for a little side project at home, I'm writing a ham radio web site in...
221
Atli
by: Atli | last post by:
You may be wondering why you would want to put your files “into” the database, rather than just onto the file-system. Well, most of the time, you wouldn’t. In situations where your PHP application...
1
by: Brit | last post by:
I have an ASP file that retrieves names from an Access database for 4 different categories of membership, which the visitor to the page selects (corporate, institutional, regular, or student). The...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.