SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    Once I was a Factory Worker goofy's Avatar
    Join Date
    Dec 2004
    Location
    Sydney Australia
    Posts
    559
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    stuck in mySQL command prompt

    I'm a newbie to mySQL and I was trying to insert some data into the database from the mysql command prompt but I've stuffed up and I'm stuck at a command prompt like the following

    '>

    but I don't know how to get back to the mysql command prompt without closing the terminal window.
    Goofy
    Life is what you make it!
    Follow your dreams!

  2. #2
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,247
    Mentioned
    59 Post(s)
    Tagged
    3 Thread(s)
    possibly it's waiting for you to close a string, try entering a single quote
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  3. #3
    Once I was a Factory Worker goofy's Avatar
    Join Date
    Dec 2004
    Location
    Sydney Australia
    Posts
    559
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i ended up just closing the terminal window. Is there anyway to exit the sql command prompt if you get the syntax wrong and can't work out how to fix it?
    Goofy
    Life is what you make it!
    Follow your dreams!

  4. #4
    SitePoint Wizard guelphdad's Avatar
    Join Date
    Oct 2003
    Location
    St. Catharines, ON Canada
    Posts
    1,708
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    look at Rudy's explanation.

    If you enter ('2006-01-01); then you are missing a single quote thus instead of seeing

    mysql >
    on the prompt you got
    '> '

    so you just now need to enter
    ';
    which is the character being asked for and then the semi-colon to close the command off.

    if you are missing a double quote you would see
    ">
    instead
    just enter ";
    to close it off.

    closing the window won't hurt anything either.

    also one other thing to note, if you realize you have made an error in your query and you want to go back and fix something enter \c at the prompt and then you will end your query and just go back to the prompt.


Bookmarks

Posting Permissions

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