为什么phpmyadmin中导入的数据库比较小?
我使用 phpmyadmin 转储了一个数据库,大小为 390MB 然后使用命令行导入到新数据库中,然后显示大小360。
为什么导入的数据库较小?谢谢。
I have dumped a database using phpmyadmin and had 390MB
and then imported it using command line into new database, then it showed the size 360.
Why this imported database is smaller? Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当您从数据库中删除数据时,记录通常不会真正从数据库文件中删除,只是标记为已删除 - 该空间可以在以后重新用于新记录。当您导出数据库时,这些已删除的记录自然不会导出,也不会在您导入数据库时重新创建。
添加记录时,这种重用可以节省一些时间,因为您不必总是增大文件。而且在删除记录时,它可以节省大量时间 - 从文件中间删除某些内容涉及移动其后面的所有数据。
When you delete data from a database, the records usually aren't actually deleted from the database files, just marked as deleted – the space can be reused for new records later. When you export a database, these deleted records naturally aren't exported, or recreated when you import the database.
This reuse saves a little time when records are added, because you don't always have to make the file larger. And it saves a lot of time when deleting records – deleting something from the middle of a file involves shifting all the data that comes after it.