AlexCl

Active Member
Feb 19, 2013
42
0
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!
 

kdean

Well-Known Member
Oct 19, 2012
407
82
78
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 ;