I could help, but I hate MySQL.
I really only use MSSQL.
It’s interesting why you think indexes need to be rebuilt?
Where did the indexes come from?
You need to have some sort of MySQL management tool, and the “rebuilding” is really nothing more than Dropping and re-creating it.
Are these manual indexes that you added after the fact, or are they from clicking the checkbox inside aware?