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.
To copy a MySQL database from a server to another, you use the following steps: Export the database on the source server to a SQL dump file. Copy the SQL dump file to the destination server. Import the SQL dump file to the destination server.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With