I would like to know how much space does my MySQL database use, in order to select a web host.
I found the command SHOW TABLE STATUS LIKE 'table_name'
so when I do the query, I get something like this:
Name | Rows | Avg. Row Length | Data_Length | Index Length
---------- ---- --------------- ----------- ------------
table_name 400 55 362000 66560
- numbers are rounded.
So do I have 362000 or 400*362000 = 144800000 bytes of data for this table? And what does Index Length mean? Thanks !
MySQL Utilities by Oracle have a command called mysqldiskusage that displays the disk usage of every database: https://dev.mysql.com/doc/mysql-utilities/1.6/en/mysqldiskusage.html
You can get the size of your Mysql database by running the following command in Mysql client
if you want to find it in MB do this
None of the answers include the overhead size and the metadata sizes of tables.
Here is a more accurate estimation of the "disk space" allocated by a database.
From S. Prakash, found at the MySQL forum:
Or in a single line for easier copy-pasting:
If you are using MySql Workbench, its very easy to get all details of Database size, each table size, index size etc.
Select Schema Inspector option
It Shows all details of Schema size
Select Tables Tab to see size of each table.
Table size diplayed in Data Lenght column