MySQL Forums
Forum List  »  Newbie

Re: How to connect to mysql and run sql commands in windows batch script?
Posted by: Barry Galbraith
Date: October 12, 2011 12:59PM

mysql -uroot -pmypassword
is a command interpreted/run by shell. ALso note there is no space between -p and mypassword

USE perftest_results;
select * from release_test_summary_results where Load_Test_Number = 760
are SQL commands, interpreted/run by mysql command client.

What I would do is put your sql commands in separate file, then pass that file to mysql, like this

mysql -uroot -pmypassword < sqlfile.sql

Good luck,
Barry.

Options: ReplyQuote


Subject
Written By
Posted
Re: How to connect to mysql and run sql commands in windows batch script?
October 12, 2011 12:59PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.