Re: MySQL DB file size

by Brian V Bonini <b-bonini(at)cox.net>

 Date:  12 Jun 2003 17:51:52 -0400
 To:  Keith D Sellars <Keith(at)webgraffix.com>
 Cc:  HWG Languages <hwg-languages(at)hwg.org>
 References:  S0026260871
  todo: View Thread, Original
On Thu, 2003-06-12 at 17:23, Keith D Sellars wrote:
> Hi guys,
> 
> Is it possible to display the file size of a MySQL database using php?  For
> my clients that use MySQL databases, I would like to create the ability for
> them to see the size of their database so that they can control whether or
> not they are going over limits that would incur additional charges for data
> storage.  I've got someone that helps me out on the programming end of
> things (does most of the complex stuff for me), and I'm sure we could do it
> if someone could point us in the right direction.
> 
> How would I do this?  Any suggestions?
> 

I don't know if it's possible to do this natively in MySQL but via 
PHP your could use filesize() and read /var/db/mysql/clients_db/files.*
(or where ever your db files live) and add up the totals of all the files
for that particular db.

-Brian

HWG: hwg-languages mailing list archives, maintained by Webmasters @ IWA