need help exporting mysql db

need help exporting mysql db

Posted by: snokarver
Posted on: 2008-06-10 18:19:00

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.

Re: need help exporting mysql db

Posted by: patricktan
Posted on: 2008-06-10 19:03:00

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 --opt dbname > dbnameDB.sql

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


Re: need help exporting mysql db

Posted by: snokarver
Posted on: 2008-06-10 19:29:00

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.

Tags: backup mysqlshell