List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:March 2 2003 6:15pm
Subject:Re: Scripting MySQL Commands
View as plain text  
At 12:25 -0500 3/2/03, Stephen Tiano wrote:
>Paul, Oliver--
>I really, really appreciate you guys taking time from your 
>respective Sundays to try and enlighten me. But I'm still getting 
>nowhere fast.
>I've gotten it to this:
>I open a new shell and type:
>    /usr/local/bin/mysql --local-infile -u root -p [the full pathname 
>up to]/Temp.sql
>at which point it informs me "incorrect database name".

Of course.  The first non-option argument, if there is one, is taken
as the name of the default database.  You need a < character before the
filename if you want to redirect the input of the command to read
from the file:

    /usr/local/bin/mysql --local-infile -u root -p < filename

>  Well, yes, the script is to create a nonexistent database and then 
>a table called "Temp" in that database.
>I'm now officially lost. 'use' would only apply to an existing database.
>By the way, I've also tried:
>    /usr/local/bin/mysql -u root -p [the full pathname up to]/Temp.sql
>to no avail.
>Soooo frustrating ...
>Steve Tiano
Scripting MySQL CommandsStephen Tiano2 Mar
  • Re: Scripting MySQL CommandsJeff Shapiro2 Mar
  • Re: Scripting MySQL CommandsPaul DuBois2 Mar
Re: Scripting MySQL CommandsStephen Tiano2 Mar