Results 1 to 6 of 6
  1. #1
    Join Date
    Aug 2002
    Location
    Long Island
    Posts
    427

    MySQL Database Info

    I looked quick and didn't see it on the Mysql website.

    But if someone knows this quick and can repsoned thank you

    I'm making a Info page on a site to see the size of the database in megs.


    What is the select query for seeing the size and any other info for a table / database?

    John

  2. #2
    I've seen this info in the phpMyAdmin project, check out that PHP source. I'm sure it will give some info.

    --Ben
    BEN HALSTED, Developer :: WebGroup Media LLC.
    Cerberus Helpdesk 2.4.0 -- Take Control of your Company Inbox!
    Combat Spam. Improve Response Times. Share Knowledge.
    http://www.cerberusweb.com/

  3. #3
    Join Date
    Aug 2002
    Location
    London, UK
    Posts
    9,037
    i thought evilwalrus might have had one of these a little while back.. might be worth a check.
    Matt Wallis
    United Communications Limited
    High Performance Shared & Reseller | Managed VPS Cloud | Managed Dedicated
    UK www.unitedhosting.co.uk | US www.unitedhosting.com | Since 1998.

  4. #4
    Join Date
    Oct 2002
    Location
    Canada
    Posts
    3,100
    My mysql data folder is /var/lib/mysql. Might be some other place in your case. For every database there is a responding folder in there.

    So if you do
    du -sh /var/lib/mysql/databasse_name
    it will give you the db size in K or M or whatever.

  5. #5
    Join Date
    Aug 2002
    Location
    Long Island
    Posts
    427
    There is a "Select" query to return the size of the database. I'm not sure what it is or how to find out what it is? I have looked around but I didn't find anything.

    I was hoping someone knew of the select query

    John
    John Trovato
    In Office Networks, LLC
    Programmer, Cisco Network Engineer, Roofer, Biochemist, and Conductor.

  6. #6
    Not a select query but a MySQL specific function:

    show table status

    for all the tables or

    show table status like 'tablename'

    for a specific table.

    You'll need a MySQL driver that supports this to access it from a program. The suggestion to look at the PPHMyAdmin code isn't a bad one.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •