Free space in MySQL after deleting tables and columns?

I have a database about 20 GB in size. I need to delete 5 tables and drop a few columns in some other three tables.

Dropping 5 tables with 3 GB free, and columns in other tables should free another 8 GB.

How to return this space from MySQL.

I read how to reset the database and restore it as one of the solutions, but I’m not sure how it works, I’m not even sure that it works only to delete the entire database or only parts of it?

Please suggest how to do this. THANKS.

+3
source share
2 answers

From the comments, it looks like you are using InnoDB without the file option for the table.

, , innodb. - , " " ( mysql). ; mk-parallel-dump restore , . .

+5

EDIT: file_per_table, Mark .

, , MySQL , . , 500 , 500, , . , , , .

, , , . : (, , ).

, , , :

OPTIMIZE TABLE my_big_table;

, , . , . - , (, ). .

MySQL. :

OPTIMIZE TABLE , ( VARCHAR, VARBINARY, BLOB TEXT). , INSERT . OPTIMIZE TABLE .

+2

Source: https://habr.com/ru/post/1778171/


All Articles