MySQL InnoDB does not free disk space after deleting data rows from table
P粉148434742
P粉148434742 2023-10-15 00:02:19
0
2
531

I have a MySQL table using the InnoDB storage engine; it contains about 2M data rows. When I delete data rows from the table, it does not free the allocated disk space. After running theoptimize tablecommand, the size of the ibdata1 file has not been reduced.

Is there any way to reclaim disk space from MySQL?

I'm in a bad situation; the application is running in about 50 different locations and now almost all of them are running out of disk space.

P粉148434742
P粉148434742

reply all (2)
P粉183077097

I encountered the same problem myself.

What happens is that even if you delete the database, innodb still does not free up the disk space. I have to export, stop mysql, delete the files manually, start mysql, create database and user, then import. Thank god I only have 200MB of rows but it saved 250GB of innodb file.

Design failed.

    P粉340980243

    MySQL does not reduce the size of ibdata1. once. Even if you useOptimize Tableto free up the space used by deleted records, it will reuse it later.

    An alternative is to configure the server to useinnodb_file_per_table, but this requires backup, deletion of the database, and recovery. On the positive side, theoptimized tables.

      Latest Downloads
      More>
      Web Effects
      Website Source Code
      Website Materials
      Front End Template
      About us Disclaimer Sitemap
      php.cn:Public welfare online PHP training,Help PHP learners grow quickly!