Use these few simple commands:
mysqldump -u username -p -v --routines olddatabase > olddbdump.sql
mysqladmin -u username -p create newdatabase
mysql -u username -p newdatabase < olddbdump.sql
Or to reduce I/O use the following as suggested by @Pablo Marin-Garcia:
mysqladmin -u username -p create newdatabase
mysqldump -u username -v --routines olddatabase -p | mysql -u username -p -D newdatabase