Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

execute source

Status
Not open for further replies.

giorgio78

Technical User
Apr 30, 2004
2
IT
Is there anybody that knows as to run a query from DOS (I tried with --execute source filename.sql and the error meassege is ERROR1102: incorrect database name filename. When I enter mysql and use directly source filename.sql the query runs).

Thank you
 
The --execute or -e option is used when you want to embed your SQL in the command line, for example:
[tt]
mysql -u username -ppassword -e "select * from tbl" dbname
[/tt]


To execute from a batch file, you would use:
[tt]
mysql -u username -ppassword dbname < sourcefile.sql
[/tt]


-----
ALTER world DROP injustice, ADD peace;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top