Delphi Pages Forums  

Go Back   Delphi Pages Forums > Delphi Forum > General

Lost Password?

Reply
 
Thread Tools Display Modes
  #1  
Old 09-23-2004, 04:56 AM
Fricas Fricas is offline
Member
 
Join Date: Sep 2004
Posts: 36
Default MYSQL database size

Hay, how can I get Mysql database or table size, i'm using zeos lib?
Thanks!
Reply With Quote
  #2  
Old 09-23-2004, 01:18 PM
AceOmega AceOmega is offline
Senior Member
 
Join Date: Sep 2004
Posts: 2,393
Default RE: MYSQL database size

Sorry no one has helped you. I can't help because I know nothing about MySQL administration. Here is a Forum which might help you. Not too many Delphi programmers there but they know their stuff when it comes to databases.

http://www.dbforums.com/f5

I hope this helps.
Reply With Quote
  #3  
Old 09-24-2004, 05:21 AM
MrBaseball34 MrBaseball34 is offline
Senior Member
 
Join Date: Jan 2001
Posts: 7,260
Default RE: MYSQL database size

Code:
var
  DL, IL: Integer;
  TN: String;
begin
  ZQuery1.SQL.Text := 'SHOW TABLE STATUS';
  ZQuery1.Open;
  DL := 0; IL := 0;
  ZQuery1.First;
  while not ZQuery1.EOF do
  begin
    TN := ZQuery1.FieldByName('Name').AsString;
    DL := DL + ZQuery1.FieldByName('Data_length').AsInteger;
    IL := IL + ZQuery1.FieldByName('Index_length').AsInteger;
    Memo1.Lines.Add('Table: ' + TN + '  Size:' + IntToStr(DL + IL));
    ZQuery1.Next;
  end;
  Memo1.Lines.Add('Database Size: ' + IntToStr( DL + IL));
  ZQuery1.CLose;
end;
If you hook up a dbgrid to the query, you'll see all the
other info returned with "SHOW TABLE STATUS'

MrBaseball34
Hook'Em Horns!
Reply With Quote
  #4  
Old 09-27-2004, 06:00 AM
MrBaseball34 MrBaseball34 is offline
Senior Member
 
Join Date: Jan 2001
Posts: 7,260
Default RE: MYSQL database size

Did the example work for you?

MrBaseball34
Hook'Em Horns!
Reply With Quote
Reply

Thread Tools
Display Modes

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT. The time now is 07:34 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.