I am beginning using mySQL and want to solve this task:
Using HeidiSQL a batch on windows task planner is to open a connection to a HeidiSQL-session using a script for updating a table.
At the moment the batch is working fine, starting the session and opening the script.
Is it possible, to make HeidiSQL automatically start the script and after having finished the script close the connection and HeidiSQL itself?
Thanks very much in advance.
** Hi Michael, I am trying to achieve the same task. Could you please help me with the code you have enterted in your batch file? Mine does not connect to HeidiSQL. Below is the code in my batch file:
SET /P AREYOUSURE=Update Bauer end of month table? (Y/[N])?
IF /I "%AreYouSure%" NEQ "Y" GOTO END
SET MYSQL_EXE="C:\Program Files\HeidiSQL\heidisql.exe"
CALL %MYSQL_EXE% --user=%DB_USER% --password=%DB_PWD% < test.sql
IF %ERRORLEVEL% NEQ 0 ECHO Error executing SQL file