- There is no space between the option
-pand the password. If your database has no password, remove the
-u username -ppasswordpart.
- If some table has a trigger, it cannot be moved to another database using above method (will result
Trigger in wrong schemaerror). If that is the case, use a traditional way to clone a database and then drop the old one:
mysqldump old_db | mysql new_db
- If you have stored procedures, you can copy them afterwards:
mysqldump -R old_db | mysql new_db