Facts, hacks and attacks from my life as a web application developer
i had an error trying to execute such script like in your example."Error Code : 1064You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ';DELIMITER ';'' at line 10"it works after i deleted quote symbols ' near ; and ;; where delimiter is defined.
It's also wise to add " where table_schema = 'database1' " in the case where you have multiple databases using the same tables and columns
thanks made these changes to get working on my systemdelimiter ;;delimiter ;no ' around delimiter and tada