Most of the time backups using mysqldump will include the following line:
This is OK when you're trying to either (re)build a slave or restore a production database. But what about restoring it to a test server in a different schema?
The actual trick
Using vi (or similar) editors to edit the line will most likely result in the editor trying to load the whole backup file into memory, which might cause paging or even crash the server if the backup is big enough (I've seen it happen). Using sed (or similar) might take some time with a big file. The quick and dirty trick I like is:
grep -v "USE \`schema\`" backup.sql | mysql -u user -p new_schema
Adapt the mysql command options to your needs. It's necessary to escape the backticks (`), otherwise the shell might interpret it as your trying to execute schema and use the output as the actual schema name. Also, make sure that new_schema already exists in the server.
This method is quick and dirty and leaves the original backup intact. I hope you find it useful.