mysqldump-remote icon indicating copy to clipboard operation
mysqldump-remote copied to clipboard

Script does not work when MySQL password contains special characters like $

Open samir-plusb opened this issue 6 years ago • 0 comments

Hey,

very nice script! Thanks for the good work!

I tested it in one of our deployment tasks and recognized, that the password will not be sent correctly to the remote host.

Example:

./bin/mysqldump-remote.sh -v --compress=1 \ 
    --ssh-user=ssh_user \ 
    --ssh-host=host.mydomain.com \ 
    --mysql-user=mysql_user \ 
    --mysql-host=localhost \ 
    --mysql-database=my_database \
    --mysql-password='my_pass_with$_character'

The command, which will be executed on the remote host, will look like this:

 mysqldump -v -u mysql_user -h host.mydomain.com -p'my_pass_with' my_database

Therefore any connection to the database server will be declined.

Any ideas how to solve this?

samir-plusb avatar Oct 10 '18 16:10 samir-plusb