Results 1 to 4 of 4

Thread: where is mysql in Batch Mode

  1. #1
    Join Date
    Jul 2003
    Posts
    421

    where is mysql in Batch Mode

    Hi all,
    I try Mysql on windows XP How can I go to
    shell> mysql < batch-file from C:\
    Thank you
    ________
    Buy grinders
    Last edited by sql; 03-06-2011 at 01:43 AM.

  2. #2
    Join Date
    Apr 2005
    Location
    florida
    Posts
    89
    mysql> source filename;
    or
    mysql> \. filename

    ex:
    mysql> source c:\pet.sql
    or
    mysql> \. c:\pet.sql


    more info: http://dev.mysql.com/doc/mysql/en/batch-mode.html

  3. #3
    Join Date
    Jul 2003
    Posts
    421
    Hi oraclable,
    Thank you for your reply, is batch file just normal file?
    is the shell would not show on windows??
    Thank you

  4. #4
    Join Date
    Aug 2006
    Posts
    1
    I figured I'd go ahead and give others searching google a break by posting my resolution. I'm also on Windows XP and I'm running MySQL 5.0.

    The problem I was having running the commands above has to do with MySQL "commands".

    Ex. \p will print out the current command. For more examples check out http://dev.mysql.com/doc/refman/5.1/...-commands.html

    Now the full path of a file in Windows also uses back slashes (\), so we run into problems when the interpreter starts thinking the path name contains MySQL commands.

    When I tried to run this the \p in "\private" was ran as the command to print out the current command. So it generated some weird errors.

    This did not work for me..
    mysql> source C:\myfiles\private\sql\myscript.sql; #BAD!

    The resolution is to use the forward slash at the MySQL Command Line Client instead..
    mysql> source C:/myfiles/private/sql/myscript.sql; #WORKS!

    The documentation for batch mode under Windows ought to clarify this because it wasn't entirely obvious.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •