Re: how to find the disk usage of mysql database

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



In message <fnmmi9+apn7@xxxxxxxxxxx>, Sudhakar <finals27@xxxxxxxxx>
writes
>hi
>
>i have mysql database installed on the main webserver and i use a pc 
>through the lan. i have couple of tables in different databases.
>
>my question is using php and mysql methods can i write a code which 
>would connect to the server where mysql has been installed on the 
>unix server and report on the following

>
>1. total capacity of mysql database installed on the unix server's 
>hard disk (this is NOT considering the entire capacity of the 
>server's hard disk capacity ONLY the total amount of data capacity 
>that mysql can hold on the unix server's hard disk)

You seem to be implying that you think that the disk limits the amount
of space available to mysql.  Think of it like any other files - the
files can expand to fill the entire disk.

The limitations of size are in the structure of the database, see
http://dev.mysql.com/doc/refman/5.0/en/full-table.html
which points out that under Windows, one database can stretch to 2
terrabytes (disk size permitting).

Of course, you can always split the data into two databases, if 2TB is
not enough for you.

>2. total amount of data already used with the existing tables

You appear to have access to the disk (this is not always the case, if
for example, you are on a shared server).  Going to my local test hard
disk, I can see that C:\wamp\mysql\data, I have 300 Mb of data in my
databases.  That's the quick and dirty way, if you have access to it.

>3. amount of data left that the mysql database can accept

As an approximation.... loads...

>please provide the code.

So you can write code, to calculate the size of each database, and
subtract it from 2TB.   Do you still need to code?

-- 
Pete Clark

Sunny Andalucia
http://hotcosta.com/Andalucia.Spain

[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Soap]     [Kernel Newbies]     [Yosemite]     [Yosemite Campsites]

  Powered by Linux