473,698 Members | 2,034 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1961
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:0f06a43aa 5="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:0f06a43aa 5]

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_lengh t" and
"index_leng ht". 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:0f06a43aa 5="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:0f06a43aa 5]

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_lengh t" and
"index_leng ht". 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:0f06a43aa 5="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_lengh t" and
"index_leng ht". 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:16866fe06 a]

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
7338
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 agent could not be started to service a request, or was terminated as a result of a database system shutdown or a force command.
2
28590
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
3099
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 Variant, tbx3 As Variant, tbx4 As Variant, tbx5 As Variant, tbx6 As Variant, tbx7 As
9
4755
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 DataSet; and all I'm doing is showing one record in text fields, allowing the user to modify the text fields, and then updating the database again when the user clicks the Save button. The fields already show the correct data record since I have...
0
7692
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 dbConnect to None. ## spec: dict(UserName=name, Password=pswd, ServerName=host) ## Allow names to be set with Default Holder. Consiter Dictionary ## or even a tuple? (name, pswd, host)"""
4
8195
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 an approximate size of the database. But it we try calculating the file system sizes of the database home directory, containers file system it gives some other size...
0
5572
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 exception is: javax.ejb.EJBException: Connection to pool failed! - com.ibm.websphere.ce.cm.StaleConnectionException: SQL1224N The database manager is not able to accept new requests, has terminated all requests in progress, or has terminated your...
2
3572
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 uby/Rails. I started it in Perl and gave up on Perl as I went from the 'display the database information on the web page' to the 're-display the information from the database and allow the user to update the database using the web page' stage and realized...
221
367510
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 needs to store entire files, the preferred method is to save the file onto the server’s file-system, and store the physical location of the file in your database. This is generally considered to be the easiest and fastest way to store files. ...
1
2359
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 DNS name is "cati", the names are specified in the "Last_names" field, and the categories are in the "categories" field. l want the results sorted in alphabetic order by last name. However, the results appear to be in a totally random,...
0
9155
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8890
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8858
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7711
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6517
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4614
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3038
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2322
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
1997
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.