I have an extremely simple script with PHP exec, calling mysql command:
$dbhost = \'localhost\';
$dbuser = \'root\';
$dbpass
The problem here is probably that
mysql < file.sql
depends on a pipe operation that is facilitated by the shell. If php executes the command directly using something like the exec*() family of api calls rather than through a shell this won't work. I know that the shell actually is used on linux, but this might not be the case on windows. The manual doesn't specify exactly how the command is executed.
Try using the -e flag and the source command instead:
bin\mysql.exe -h localhost --user=root --password=mypass -e 'source job_create.sql'
This should work regardless of the way that the command is invoked.