I wanted to create a MySQL dump of a small DB, so run mysqldump and realized that what I was expecting to take a few MB was instead half a GB.
Where did things go wrong? Which table is storing such an unexpected amount of data?
Googling around I've found a few interesting posts on how to check the size of a table, and then selected this one.
My suggested approach is:
I've then immediately spotted the "offending" table :-)
Where did things go wrong? Which table is storing such an unexpected amount of data?
Googling around I've found a few interesting posts on how to check the size of a table, and then selected this one.
My suggested approach is:
SELECT TABLE_NAME, table_rows, data_length, index_length, round(((data_length + index_length) / 1024 / 1024),2) "Size in MB" FROM information_schema.TABLES WHERE table_schema = "schema_name";where schema_name is the DB you're interested in.
I've then immediately spotted the "offending" table :-)