docker-db-backup icon indicating copy to clipboard operation
docker-db-backup copied to clipboard

mySQL/MariaDB - Backup fails when password contains spaces

Open dontoverthinkit opened this issue 4 years ago • 3 comments

Hi, first and foremost, thank you for the great work on this container!

I have four instances of this container installed, 3 backing up successfully, 1 not. 2 x MariaDB - NO spaces in password - successful 1 x Postgres - spaces IN password - successful 1 x MariaDB - spaces IN password - NOT successful.

I have enabled debug mode and am able to reproduce the behaviour by copying the mysql command (below) from the debug output and executing it from within the db-backup container.

(I have changed the words used for the password, but have maintained the length of each individual word, and the case, type of character used.)

Once I place quotes around the password, the command executes as expected. Without them, components of the password after the first space are being treated as options being passed to mysql and are errorring out as unsupported (unrecognised) options.

mysql -umonicauser -P 3306 -h monica_mariadb -pgreen balloon mauve buster -e 'SELECT COUNT(*) FROM information_schema.FILES;'

dontoverthinkit avatar Mar 14 '20 00:03 dontoverthinkit

Makes sense. Spaces in passwords are a bit odd to me, but I can take a peek at the code and change the quoting around.

tiredofit avatar Mar 14 '20 02:03 tiredofit

New build tiredofit/db-backup:1.18.1 or latest being built which should allow you to get spaces in the password. Let me know..

tiredofit avatar Mar 14 '20 15:03 tiredofit

@tiredofit - nice work on turning around so quickly. I should have mentioned that I changed the password to not contain spaces, so only raised the issue for completeness / your awareness if you wanted to address.

I've pulled both 'latest', and by the tag 'tiredofit/db-backup:1.18.1', changed the password back to the original one that had the issue, and still am seeing the same behaviour.

Let me know what information would be helpful for you in troubleshooting if you want to track this down. I have attached an extract from the debug output that I think is relevant.

I've again changed the password but not format, characters, length of password, or length of individual components.

db-backup-debug-output-MYSQL-password-with-spaces-error.txt

I'm happy to help if you do want to knock this on the head

dontoverthinkit avatar Mar 15 '20 08:03 dontoverthinkit