How to shrik or optimize table in mySQL database

Hi All,

I want shrink table in MYSQL database, Please let me know the steps and requirements.

1.Query for Shrink
2.Is there any space requirement  for table Shrink to calculate required space for table shrink.

Please some help me with script and calculations.

GK GKAsked:
Who is Participating?
Guy Hengel [angelIII / a3]Connect With a Mentor Billing EngineerCommented:
1: optimize table
followed by this statement:

2 & 3: yes, the space needed for the resulting table size (as the table is rebuild side-by-side) and then the old one is replaced/deleted. so, if you table has 1MB size, you will need max 1 more MB free space for this
Dave BaldwinConnect With a Mentor Fixer of ProblemsCommented:
There is the OPTIMIZE TABLE command but I don't think there is any way to calculate the results.
GK GKAuthor Commented:
Thanks for update
All Courses

From novice to tech pro — start learning today.