Need help exporting mysql db

I’ve been requested to export out a MySQL DB via the command line. The requester specifically said not to use phpMyAdmin. I tried following these steps: but it throws an error. It seems to think my password is a command.

[server]$ mysqldump -uusername -p^password -h dbname > dbnameDB.sql
-bash: password: event not found

Any ideas? Thanks in advance.

It is not safe to give password in the command. You should never let your password visible to others.

Try this
mysqldump -uusername -p [color=#CC0000]–opt[/color] dbname > dbnameDB.sql

Press enter and key in your password after the prompt. It is safer this way

$50 off and 3 free domains with code: [color=#CC0000]DH3[/color] Sign Up NOW or More Codes Here

It was a test DB so I wasn’t too concerned. Anyway, doing that did seem to solve the problem. It really didn’t like the password inline (and I did use --opt.)