Hey
I'm trying to pipe output from mysqldump to mysql using a pipe. It works just fine in a dos prompt, but fails when I use it in ShellExecute.
The simplified command is:
The cmd window pops up for a split second then closes, too fast to see what it says - anyone know how to prevent it from closing?
If I run that in a loop, I can step through the loop (F8) and the cmd window re-opens so often that I can make out what it says - authentication failure. It's not treating the pipe character as a pipe, it's not treating the stuff after the pipe symbol as a separate "mysql" command, but as arguments to the first "mysqldump" command.
Same problem if instead I try "foo > somefile.txt", the chevron is not treated as redirection.
How do I feed data from one command to another via a pipe? Must work in WinXP and Win10.
I'm trying to pipe output from mysqldump to mysql using a pipe. It works just fine in a dos prompt, but fails when I use it in ShellExecute.
The simplified command is:
Code:
r = ShellExecute(0, "open", "mysqldump.exe", _
"mysqldump --user=foo --password=foo --host=192.168.1.2 --compress --verbose some_db | mysql --user=bar --password=bar --host=localhost some_db", _
mariadbPath & "\bin", 1)
If I run that in a loop, I can step through the loop (F8) and the cmd window re-opens so often that I can make out what it says - authentication failure. It's not treating the pipe character as a pipe, it's not treating the stuff after the pipe symbol as a separate "mysql" command, but as arguments to the first "mysqldump" command.
Same problem if instead I try "foo > somefile.txt", the chevron is not treated as redirection.
How do I feed data from one command to another via a pipe? Must work in WinXP and Win10.