You should be able to use "source":
http://dev.mysql.com/doc/r
Main Topics
Browse All TopicsI have and external file that contains my db query. It is sitting on my C:/. It will create the db, the tables and values. The files is call taskDBsetup.sql
How do i run this query/file from the mysql> prompt?
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
You should be able to use "source":
http://dev.mysql.com/doc/r
Business Accounts
Answer for Membership
by: Mike_The_SpikePosted on 2009-09-15 at 11:51:21ID: 25337990
If your mysql client is on the same computer as your .sql script, you would use the source command.
I suspect that your script is on your local computer, and your mysql client is on another computer that you access via telnet or ssh. In this case, you can either copy and paste the contents of the script into the telnet window, or you can copy the file to the computer that has the mysql client, and then use the source command to run it.
You can get your script to the mysql client by using ftp or scp, or by recreating it by opening a text editor on the computer that has your mysql client and copying and pasting from a text editor on your local machine.
I keep reffering to "the computer that has the mysql client" because it it technically posible that there are three computers in this situation. Your local machine, the mysql server, and another machine that sits between them. In many cases, the mysql server and mysql client are on the same computer.
You could also look into navicat http://www.navicat.com/ (assuming there are no firewalls preventing traffic between your mysql server and you local computer)
Once you've set up a connection to your server, right click on the database and choose "Execute Batch File". It will handle the rest.