The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Total MySQL disk usage

Discussion in 'Database Discussions' started by AlexCl, Apr 23, 2013.

  1. AlexCl

    AlexCl Active Member

    Joined:
    Feb 19, 2013
    Messages:
    40
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Root Administrator
    Hi guys,

    I'm looking at migrating to a new server with SSD's for the OS and MySQL and wanted to find out how much space MySQL is currently using. I've looked around Google but haven't been able to find a solution.

    Is there any option in WHM to see total MySQL disk usage ? Or any other option?

    Thanks!
     
  2. kdean

    kdean Well-Known Member

    Joined:
    Oct 19, 2012
    Messages:
    262
    Likes Received:
    12
    Trophy Points:
    18
    Location:
    Orlando, FL
    cPanel Access Level:
    Root Administrator
    For raw file usage, go to shell

    Code:
    du -ksh /var/lib/mysql/
    or for individual databaseses

    Code:
    du -ksh /var/lib/mysql/*
    or to see what MYSQL reports as the size (which depending on your database type may report less than the actual file size), go to PHPMyAdmin from WHM, select SQL at the top and paste and run:

    Code:
    SELECT table_schema "Data Base Name", 
    sum( data_length + index_length ) / 1024 / 
    1024 "Data Base Size in MB", 
    sum( data_free )/ 1024 / 1024 "Free Space in MB" 
    FROM information_schema.TABLES 
    GROUP BY table_schema ; 
     
  3. AlexCl

    AlexCl Active Member

    Joined:
    Feb 19, 2013
    Messages:
    40
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Root Administrator
    Hi kdean,

    Thank you very much for that, exactly what I needed.

    Cheers!
     
Loading...

Share This Page