The glitch gives the answer, usually a good one, but the stored procedures and functions will not be in the backup, therefore they will not be copied to the second database.
This is why I always do ( --routines can be used instead of -R in the command below):
$ mysqldump ${source_db} -R | mysql ${dest_db}
In fact, since I am doing a regular dump for backup purposes, I prefer to use the backup dump itself, so I store it in a file:
mysqldump ${source_db} -R > ${source_db}.sql mysql ${dest_db} < ${source_db}.sql
Note: I always avoid the -u and -p options for security reasons .
Bruno source share