PDA

View Full Version : Getting Database Usage



YUPAPA
May 31st, 2002, 23:58
Anyone knows how to get mySQL Database Disk Usage?
the most easiest, fastest and the best way?

----------------------------------------------------------------------------------
this is my plan on how to track a user database usages
Example: user - yupapa

1. a script connect to mySQL database (which contains all mySQL users and databases info)

2. get the all databases owned by yupapa
Lets say yupapa has two databases: 'dns' and 'beer'

3. go to each database directory and add up the bytes of each tables.
- /var/lib/mysql/dns
- /var/lib/mysql/beer

4. output the bytes to a file
-----------------------------------------------------------------------------------

Do you know any better way than that?

keith
June 1st, 2002, 13:12
i like bread!

YUPAPA
June 1st, 2002, 13:24
Okay :classic2: