2.6.1.22. Why database size varies from place to place

The size of a database can be calculated differently depending on the context:

  • The "Databases" section displays the total file size of the database tables.
  • In phpMyAdmin, the total size of the data itself in the database tables is displayed.
  • In the "Backups" section, the size of the archived SQL dump is displayed for the created database backup. The size of the dump will always differ from the size of the table files or the amount of data in it, since it is a fundamentally different format.
  • An SQL database dump that is created via the "Backups" may differ from a dump that was created via phpMyAdmin. However, the data in the dump itself will be the same, and importing such dumps will yield the same result.

In addition, when using InnoDB tables, their size can only increase, and simply deleting data from these tables does not reduce the size of their files. To reduce the file size, you need to export the database, recreate it, and import the data back.

Content

    (1)