Fix upgrade script for MySQL 5