For InnoDB, the following seems to work: create the new empty database, then rename each table in turn into the new database:
RENAME TABLE old_db.TABLE TO new_db.TABLE;
After the rename you have to adjust the permissions of the table!
To generate a script to generate the sql to rename all tables you can get all tablenames
from the information schmema:
SELECT concat('RENAME TABLE $1.',TABLE_NAME, ' TO $2.',TABLE_NAME, ';') FROM information_schema.TABLES WHERE table_schema='$1';
An alternative way is to dump all the table structur and data and import it again to mysql. This is an easy method if your database is not to big.
Use these few simple commands
mysqldump --routines -u username -p -v olddatabase > olddbdump.sql mysqladmin -u username -p create newdatabase mysql -u username -p newdatabase < olddbdump.sql
If ALL your tables are MyIsam you just can move the files which contain the tables. For this you create the new database and shutdown mysql. Move all the files from the old database folder to the newly created one.