SourceForge has been redesigned. Learn more.
Close

#28 Passwords with spaces cause script to fail

v2.5
closed-fixed
nobody
None
5
2011-08-14
2010-07-17
baron
No

I downloaded version 2.5.1 to backup my databases. Unfortunately, when I ran the script I was greeted with a large number of errors. After some troubleshooting, I found that passwords that contain spaces will cause the script to fail. The password variable needs quotes added around it to address the issue.

These lines...
DBNAMES="`${MYSQL} --user=${USERNAME} --password=${PASSWORD} --host=${DBHOST} --batch --skip-column-names -e "show databases"| ${SED} 's/ /%/g'`"
${MYSQLDUMP} --user=${USERNAME} --password=${PASSWORD} --host=${DBHOST} ${OPT} ${1} > ${2}

Needs to be...
DBNAMES="`${MYSQL} --user=${USERNAME} --password="${PASSWORD}" --host=${DBHOST} --batch --skip-column-names -e "show databases"| ${SED} 's/ /%/g'`"
${MYSQLDUMP} --user=${USERNAME} --password="${PASSWORD}" --host=${DBHOST} ${OPT} ${1} > ${2}

Discussion

  • PittaGurneyi

    PittaGurneyi - 2011-08-14
    • status: open --> closed-fixed
     
  • PittaGurneyi

    PittaGurneyi - 2011-08-14

    Fixed in version 3.0_beta.

     

Log in to post a comment.