dockerwest/compose-pimcore

Helper: mysqldump adds console output to file

Closed this issue · 6 comments

Hey again,

I'm trying out some of the helpers and trying to import an earlier exported MySQL dump fails due to text inside the file that shouldn't be there.

The beginning of my mysqldump database > dbdump.sql looks like the following:

mysqldump: [Warning] Using a password on the command line interface can be insecure.
-- MySQL dump 10.13  Distrib 5.7.22, for Linux (x86_64)

This causes the mysqlimport database dbdump.sql to fail.

Is it my system causing this issue or the helper function? When deleting the first line the import works perfectly. Maybe there can be an option to surpress console output being pushed into the file when created.

Thanks again! :-)

Currently there is not yet a solution for this, when we are using docker exec stdout and stderr are merged in stdout. There were several issues in the docker project for this if I remember correctly, but none of those resolved the issue.

Maybe we could actively filter this line out?

There are several proposals for a solution in here.
mysql_config_editor looks the most promissing and up-to-date solution to me.

Maybe we could set it from the mysqldump py script before executing the mysqldump.
What do you guys think?

Another solution I found is to remove the -t option from the docker exec command as pointed out here.

For testing I simply removed lines 40 and 41 from https://github.com/dockerwest/compose-pimcore/blob/master/bin/mysqldump#L40 which prompted the warning to the CLI and didn't include it in the exported SQL file. Exporting and importing works fine now!

Not sure if this screws up something else since the -t option is removed though.

@ppi-buck thanks I just see the check is wrong, will push an update later

@ppi-buck this should now be fixed in 897385b