I ran the analyze table command on production mysql db without knowing it would prevent me from selecting the contents of the table. This caused production site to go down :( How long can it take for the lock to release? Also, would recreating the db from a backup solve the problem / get rid of the locks?
Please let me know.
Thanks.
ANALYZE TABLE quite clearly says 'During the analysis, the table is locked with a read lock for InnoDB and MyISAM'.
You can
KILL {connection number}
in SQL to stop the command.Note: you probably should update to a more recent version of MySQL-5.6.