Batch file to connect mysql and run commands

后端 未结 3 398
闹比i
闹比i 2021-01-24 05:47

I want to run a batch file from windows, which connect to mysql server on different machine, and run a procedure from database or run a sql file which is sitting in my local mac

3条回答
  •  广开言路
    2021-01-24 06:22

    This way the sql statement can be given inside the batch file.

    mysql --host=ipaddress --port=3306 -u root -ppassword dbname -e "insert into emp ('id', 'name') values (1, 'hawk')"
    

提交回复
热议问题