Database size different after export/import

mysql

Solution

112,3 Mio what? Rows? b?

If it's storage size, there's not much to worry about, it's about how disk space usage is optimized (vacuum/optimize table). http://dev.mysql.com/doc/refman/5.1/en/optimize-table.html

On the other hand if it'S rows, you'll have to track down the tables that differ and figure out why.

use(replace schema name)

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 = "test"   
union all
SELECT 'total', sum(table_rows), sum(data_length), sum(index_length), 
sum(round(((data_length + index_length) / 1024 / 1024),2)) "Size in MB"
FROM information_schema.TABLES WHERE table_schema = "test"   group by 1

Problem

I had to export mysql database using mysqldump for backup reasons. To compare the size given by phpmyadmin, I downloaded the dump on my local machine then import the dump using SQLYog into a local database. Now, when I compare the size given by phpmyadmin on my machine and the remote machine, I end up with the imported database on my local machine to be smaller than the one on the remote machine : - remote machine database size : 112,3 Mib - local machine database size : 95,7 Mib I would like to know what could be the reasons for such a difference ? Cheers

Original source