If your text file looks like:
create table Blah (
blahID int not null auto_increment,
data int
);
INSERT INTO Blah (data) values (1);
INSERT INTO Blah (data) values (2);
for example, and want to create the table and insert the data is blahdb, you can simply do the following:
mysql blahdb < textfile.txt
Of course, if you need to log in with a username and password to access blahdb from the command line (which you should), use syntax like:
mysql -u username -p blahdb < textfile.txt
and you will be prompted for your password and then the commands within textfile.txt will be executed.
Hope this helps!
-Rich