MySQL commands not running automatically through batch script

Asmita posted 3 years ago in Running SQL scripts

I'm trying to execute MySQL commands written in .sql file through a batch script. The batch script runs just fine, connecting to MySQL server through HeidiSQL. However, after connecting to the database it just opens the commands of the .sql file in a new query window and stops. It does not execute the commands automatically, I have to press F9 to do so. Is there any way to make the .sql file run the commands automatically when batch script is called through command prompt.

Contents of batch script:

"C:\Program Files\HeidiSQL\heidisql.exe" -d=Dev -n=0 -h=abc -u=user -p=pwd -P=3306 "path\to\Stored_Proc.sql"

Contents of .sql file:

call db_name.Proc_name;

ansgar posted 3 years ago

No, there is no command line parameter to tell HeidiSQL to actually fire the loaded SQL.

Asmita posted 3 years ago

So are you saying that there isn't any way to execute the .sql commands through batch script?

Please login to leave a reply, or register at first.