If you have a look at the MySQL ddl script https://opencast.jira.com/svn/MH/trunk/docs/scripts/ddl/mysql5.sql you will notice that the first lines are:
drop schema if exists matterhorn;
create schema matterhorn DEFAULT CHARACTER SET = 'utf8';
This will probably work in most cases. But it might also delete an old database you want to keep (i.e. “matterhorn” is the name of the 1.3 database, you want to keep it and created a new db for 1.4 called “matterhorn14”)
Furthermore, all documentation regarding Matterhorn and MySQL tell you to create a new database anyway. So just remove these tree lines and tell the user to execute the SQL code in the db of his choice.