57
13
I am running a mysqldump via a bash script and have encountered a problem with a password that contains special characters.
mysqldump -hlocalhost -uUSERNAME -pPA$$W0RD DATABASE |
gzip > /home/USERNAME/backups-mysql/BACKUP.gz
How do I escape the password?
1On Windows I found I had to use double quotes. Single quotes did not work. (MySQL 5.6) – TheStoryCoder – 2015-03-25T08:08:40.297
1blanks in the password also require the ' ' – Hafenkranich – 2018-10-22T12:43:05.217
Do you know how to escape apostrophes within the password? – Steve Mayne – 2013-05-14T20:00:18.100
3@SteveMayne i think its just a backslash before it – psynnott – 2013-05-15T06:33:23.770
3parenthesis also need to be in quotes. – Félix Gagnon-Grenier – 2014-06-05T17:12:21.770