Need help exporting mysql db


#1

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: http://wiki.dreamhost.com/Backup_MySQL#Getting_a_Backup_From_the_Shell but it throws an error. It seems to think my password is a command.

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

Any ideas? Thanks in advance.


#2

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

Try this
mysqldump -uusername -p -hmysql.domain.com [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


#3

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.)

Thanks.