I'm using below script to update a table in mysql db which is installed in my local machine.
update.sql
use test;
update test.stockcurrent set units='0' where units<'0';
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 fine in if mysql is running locally in my machine.
But Now I need to connect to mysql which is running remotely and I need to execute the script from my local machine. How can I do this?