If you have access to MySQL Admin you can do it from there.
I have a DB that is about 650 megabytes and do the optimize once a month. It takes about an hour.

Not sure where the info that it takes minutes is coming from but that has not been my experience at all.

The analyze option can be used if you have a corrupt table as a second opinion. There are a ton of tables in this main DB and once in while one of them will take a shot across the bow and need to be repaired.

As always make a complete back up of the *.sql prior to running any commands on it. If the db has a bad table it won't let you do a backup more than likely.