Database size

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Sharif T. Karim

    Database size

    How would I get the total size of a mysql database in MB format?

    --
    Sharif T. Karim
    ....you don't know wrath yet...


  • Andy Hassall

    #2
    Re: Database size

    On Mon, 19 Jul 2004 22:49:53 GMT, "Sharif T. Karim" <sharif@nyc.rr. com> wrote:
    [color=blue]
    >How would I get the total size of a mysql database in MB format?[/color]

    Log on to the database server, find the data directory, and use "du -hs" on
    the directory.

    --
    Andy Hassall <andy@andyh.co. uk> / Space: disk usage analysis tool
    http://www.andyh.co.uk / http://www.andyhsoftware.co.uk/space

    Comment

    • steve

      #3
      Re: Database size

      "Sharif T. Karim" wrote:[color=blue]
      > How would I get the total size of a mysql database in MB format?
      >[/color]


      --
      http://www.dbForumz.com/ This article was posted by author's request
      Articles individually checked for conformance to usenet standards
      Topic URL: http://www.dbForumz.com/PHP-Database...ict131072.html
      Visit Topic URL to contact author (reg. req'd). Report abuse: http://www.dbForumz.com/eform.php?p=437579

      Comment

      • steve

        #4
        Re: Re: Database size

        "steve" wrote:[color=blue]
        > [quote:0f06a43aa 5="Sharif T. Karim"]How would I get the total[/color]
        size of[color=blue]
        > a mysql database in MB format?
        >[/color]
        http://www.webmasterworld.com/forum88/2069.htm[/quote:0f06a43aa 5]

        Sorry, the above URL is password protected.
        Here’s how to do it from php.
        do a mysql "show table status"
        which produces a number of columns including "data_lengh t" and
        "index_leng ht". Simply add these two number and furthere add them
        for all the return records (i.e. tables), and you get the db size.

        --
        http://www.dbForumz.com/ This article was posted by author's request
        Articles individually checked for conformance to usenet standards
        Topic URL: http://www.dbForumz.com/PHP-Database...ict131072.html
        Visit Topic URL to contact author (reg. req'd). Report abuse: http://www.dbForumz.com/eform.php?p=437580

        Comment

        • Sharif T. Karim

          #5
          Re: Re: Database size

          steve, being the foo steve is, wrote:[color=blue]
          > "steve" wrote:[color=green]
          > > [quote:0f06a43aa 5="Sharif T. Karim"]How would I get the total[/color]
          > size of[color=green]
          > > a mysql database in MB format?
          > >[/color]
          > http://www.webmasterworld.com/forum88/2069.htm[/quote:0f06a43aa 5]
          >
          > Sorry, the above URL is password protected.
          > Here's how to do it from php.
          > do a mysql "show table status"
          > which produces a number of columns including "data_lengh t" and
          > "index_leng ht". Simply add these two number and furthere add them
          > for all the return records (i.e. tables), and you get the db size.[/color]

          Would I have to do a loop to get the total? Or just those array variables
          will have the total together?

          --
          Sharif T. Karim
          ....you don't know wrath yet...


          Comment

          • steve

            #6
            Re: Re: Re: Database size

            "Sharif T. Karim" wrote:[color=blue]
            > steve, being the foo steve is, wrote:[color=green]
            > > "steve" wrote:[color=darkred]
            > > > [quote:0f06a43aa 5="Sharif T. Karim"]How would I get the[/color][/color][/color]
            total[color=blue][color=green]
            > > size of[color=darkred]
            > > > a mysql database in MB format?
            > > >[/color]
            > > http://www.webmasterworld.com/forum88/2069.htm[/color]
            >
            > Sorry, the above URL is password protected.
            > Here’s how to do it from php.
            > do a mysql "show table status"
            > which produces a number of columns including "data_lengh t" and
            > "index_leng ht". Simply add these two number and furthere add[/color]
            them[color=blue]
            > for all the return records (i.e. tables), and you get the db size.[/color]

            Would I have to do a loop to get the total? Or just those array
            variables
            will have the total together?
            [/quote:16866fe06 a]

            Sharif, each row of the result set would have two values that you
            need: the index size, and the data size. Each row pertains to a
            single table.

            So you have to loop thru all the returned rows, and add these numbers
            up to get the total size of the database.
            Here is another page, just copy the code!


            --
            http://www.dbForumz.com/ This article was posted by author's request
            Articles individually checked for conformance to usenet standards
            Topic URL: http://www.dbForumz.com/PHP-Database...ict131072.html
            Visit Topic URL to contact author (reg. req'd). Report abuse: http://www.dbForumz.com/eform.php?p=440087

            Comment

            Working...