Archive: Issues executing MySQL commands


Issues executing MySQL commands
I'm trying to run a series of MySQL commands I've put into a file (updates various values if the user specifies a different path than the default). Anyways, whatever methods I do with ExecCMD or ExecDOS, none seem to work.

If I manually try the following from the command line, it works just fine. The commands in the batch file are executed.


E:\mysql\bin\mysql.exe --user=root --password=cacti --database=cacti < %TEMP%\batch.txt


Here are a few things which I've unsuccessfully tried. Either I get an error about the ODBC user denied and didn't specify a password or a just the standard MySQL help screen.

ExecCmd::exec /TIMEOUT=5000 "$INSTDIR\mysql\bin\mysql.exe --user=root --password=cacti --database=cacti < $TEMP\batch.txt" ""

ExecDOS::exec '"$INSTDIR\mysql\bin\mysql.exe" --user=root --password=cacti --database=cacti < $TEMP\batch.txt' "" "$IISDIR\cacti\log\mysql_batch.txt"


Why is MySQL so picky? I'm using this exact same format for executing other commandline programs.

Well I don't understand it. I was messing around got the following to work. Weird.


ExecCmd::exec /TIMEOUT=${EXECTIMEOUT} '$INSTDIR\mysql\bin\mysql.exe --user=root --password=cacti --database=cacti < "$TEMP\batch.txt"' ""