Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6092461
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T12:26:42+00:00 2026-05-23T12:26:42+00:00

Is there a quick way to determine how much disk space a particular MySQL

  • 0

Is there a quick way to determine how much disk space a particular MySQL table is taking up? The table may be MyISAM or Innodb.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T12:26:42+00:00Added an answer on May 23, 2026 at 12:26 pm

    For a table mydb.mytable run this for:

    BYTES

    SELECT (data_length+index_length) tablesize
    FROM information_schema.tables
    WHERE table_schema='mydb' and table_name='mytable';
    

    KILOBYTES

    SELECT (data_length+index_length)/power(1024,1) tablesize_kb
    FROM information_schema.tables
    WHERE table_schema='mydb' and table_name='mytable';
    

    MEGABYTES

    SELECT (data_length+index_length)/power(1024,2) tablesize_mb
    FROM information_schema.tables
    WHERE table_schema='mydb' and table_name='mytable';
    

    GIGABYTES

    SELECT (data_length+index_length)/power(1024,3) tablesize_gb
    FROM information_schema.tables
    WHERE table_schema='mydb' and table_name='mytable';
    

    GENERIC

    Here is a generic query where the maximum unit display is TB (TeraBytes)

    SELECT 
        CONCAT(FORMAT(DAT/POWER(1024,pw1),2),' ',SUBSTR(units,pw1*2+1,2)) DATSIZE,
        CONCAT(FORMAT(NDX/POWER(1024,pw2),2),' ',SUBSTR(units,pw2*2+1,2)) NDXSIZE,
        CONCAT(FORMAT(TBL/POWER(1024,pw3),2),' ',SUBSTR(units,pw3*2+1,2)) TBLSIZE
    FROM
    (
        SELECT DAT,NDX,TBL,IF(px>4,4,px) pw1,IF(py>4,4,py) pw2,IF(pz>4,4,pz) pw3
        FROM 
        (
            SELECT data_length DAT,index_length NDX,data_length+index_length TBL,
            FLOOR(LOG(IF(data_length=0,1,data_length))/LOG(1024)) px,
            FLOOR(LOG(IF(index_length=0,1,index_length))/LOG(1024)) py,
            FLOOR(LOG(IF(data_length+index_length=0,1,data_length+index_length))/LOG(1024)) pz
            FROM information_schema.tables
            WHERE table_schema='mydb'
            AND table_name='mytable'
        ) AA
    ) A,(SELECT 'B KBMBGBTB' units) B;
    

    Give it a Try !!!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there a quick way to determine whether you are using certain namespaces in
Is there a quick way to determine if a method call will run under
Is there a quick way to determine whether a Visual Studio C++ project is
Is there a quick way to determine the version of the Boost C++ libraries
Is there a quick way to join paths like the Join-Path function in Powershell?
Is there a quick way to find every match of a regular expression in
is there a quick way to sort the items of a select element? Or
Is there a quick way to detect classes in my application that are never
Is there a quick way to set an HTML text input ( <input type=text
In Spring 2.0, is there a quick way to have a list of the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.