Reputation: 1255
mysqldump -u censored -'p32dasdA)k+~Ow9' censored > backup.sql
The above code results in error bash: syntax error near unexpected token `)'
I assume it's because the password contains certain characters, but I'm not sure how to resolve the issue. Also, where should I check for the backup after it's complete?
Any help is greatly appreciated.
Upvotes: 5
Views: 12817
Reputation: 1
Try the following:
mysqldump dbname -u username -p > backupfilename
Upvotes: -1
Reputation: 11
try this my friend:
mysqldump -u user -p 'database_name' > file.sql
user = your username mysql
Upvotes: 0
Reputation: 6318
Try this: mysqldump -u censored -p censored > backup.sql
Then enter the password when prompted. The syntax error comes from mysql seeing the '-' and looking for a valid option, when it gets to ')' it knows there is a problem and throws the syntax exception.
Upvotes: 10
Reputation: 26360
mysqldump -u censored -p 'p32dasdA)k+~Ow9' censored > backup.sql
or
mysqldump -u censored -p '32dasdA)k+~Ow9' censored > backup.sql
Upvotes: 0
Reputation: 191729
I think you mean to use -p'
instead of -'p
, or maybe -p'p
. It would also be more secure to not type the password in there but instead use -p
with no argument and type the password when prompted.
Upvotes: 2