drush_log(sprintf("Importing database using command: %s",$cmd));
# pipe handling code, this is inspired by drush_provision_mysql_pre_provision_backup()
# we go through all this trouble to hide the password from the commandline, it's the most secure way (apart from writing a temporary file, which would create conflicts in parallel runs)
$mycnf=sprintf('[client]
host=%s
user=%s
password=%s
',$db_host,$db_user,$db_passwd);
$descriptorspec=array(
0=>array("file",$dump_file,"r"),
1=>array("pipe","w"),// stdout is a pipe that the child will write to
2=>array("pipe","w"),// stderr is a file to write to
3=>array("pipe","r"),// fd3 is our special file descriptor where we pass credentials
# we go through all this trouble to hide the password from the commandline, it's the most secure way (apart from writing a temporary file, which would create conflicts in parallel runs)