I want to create batch file to execute all my .sql scripts. I have scripts in .SQL file.
update.sql
use DatabaseName;
INSERT INTO alarm_day (al_id,al_day,activate) VALUES (12,'test','test')
update.bat
@ECHO OFF
SET MYSQL_EXE="C:\Program Files\MySQL\MySQL Server 5.6\bin\mysql.exe"
SET DB_USER=root
SET DB_PWD=password
CALL %MYSQL_EXE% --user=%DB_USER% --password=%DB_PWD% < update.sql
IF %ERRORLEVEL% NEQ 0 ECHO Error executing SQL file
above Code is working on localhost, But what we need to do when Database is on different server(Host).