导出的mysql不一样大_导出/导入后数据库大小不同

bd96500e110b49cbb3cd949968f18be7.png

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

解决方案

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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值