Re: mysqldump and special characters in the password [solved]
On 09/01/2006 12:30 PM, Hans du Plooy wrote:
On Thu, 2006-08-31 at 23:34 +0200, Hans du Plooy wrote:
On Thu, 2006-08-31 at 08:06 -0500, Mumia W. wrote:
mysqldump -u root --password=p@$$w0rd web8_db1
This fails. But I can log in with mysql -u root -p and then type the
password in, and that works.
How do I get mysqldump to deal to deal with the funny characters?
Put single quotes around the password.
That's the first thing I tried - I tried escape characters too - no joy.
OK, I don't know why there's a difference, but defining a variable,
PASSWORD="p@$$w0rd" and then calling:
mysqldump -u root -p$PASSWORD web8_db1 > wherever.sql
Investigate the contents of the PASSWORD variable. In
double-quoted strings, "$$" expands to the current shell's
PID. When I defined PASSWORD the way you did, PASSWORD
That's because my shell's PID is 2324. Just be sure you know
the actual root mysql password before closing the shell you
used to dump the database.