command line for sql script

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • network lines

    #1

    command line for sql script

    I made a script to create a table
    and insert some values, but I am having trouble
    executing the correct script after I save it into a *.sql file.
    What's the command sequence???

    mysql> ????

    please post here..
    tia
  • Bill Karwin

    #2
    Re: command line for sql script

    network lines wrote:[color=blue]
    > I made a script to create a table
    > and insert some values, but I am having trouble
    > executing the correct script after I save it into a *.sql file.
    > What's the command sequence???[/color]

    I believe it is:
    mysql> source myscript.sql

    See:
    http://dev.mysql.com/doc/mysql/en/mysql_Commands.html

    But I seldom run scripts from within the mysql command interpreter.
    I usually run them from the UNIX shell command-line:

    $ mysql -u mydatabaseuser mydatabase < myscript.sql

    Regards,
    Bill K.

    Comment

    Working...