I ran the following query to get the database sizes:
SELECT table_schema "DB Name",
Round(Sum(data_length + index_length) / 1024 / 1024, 1) "DB Size in MB"
FROM information_schema.tables
GROUP BY table_schema;
And I noticed one database taking up 8GB. So I went into that database and started truncating some of the tables. When I re-ran the query above, it says the one database that I was cleaning up went down to 200MB.
I then went into bash and did a df -h
, but I noticed that my disk usage went down from only 95GB to 93GB. I was expecting it to go down to 87G since the MySQL command seemed to indicate I got rid of 8GB worth of data. Why the discrepancy?