What does an arrow ("->") symbol mean on the command line?

55,217

Solution 1

In the MySQL command-line tool that means the tool expects your input to continue on the next line. Here it is waiting for the destination path.

Common "full" SQL commands are written with indents, which is supported at the command line. You would say something like

SELECT
    `users`.*
FROM
    `users`
WHERE
    `users`.`is_active` = 1 AND
    `users`.`age` < 13
ORDER BY
    `users`.`username`

Solution 2

The arrows are an interactive continuation prompt. If you enter an unfinished command, the SQL shell (invoked by the mysql command) is waiting for the rest of it.

In this particular case, the SQL shell is waiting for a destination path for the mysqldump.

Also, commands aren't complete until you terminate commands with a semicolon. (Thanks @MrStatic)

Solution 3

You do indeed have a syntax error; SQL commands must end with a semicolon. For example:

mysqldump my_database;
Share:
55,217

Related videos on Youtube

Josh Leitzel
Author by

Josh Leitzel

Ruby ± Rails, JavaScript | CoffeeScript | Angular I can be contacted at [email protected]. Twitter GitHub Blog

Updated on September 17, 2022

Comments

  • Josh Leitzel
    Josh Leitzel over 1 year

    I'm working with Terminal (Mac OS X), but I think this is a built-in part of Linux. Sometimes, when I execute a command, Terminal returns a new, indented line with just -> on the line. It seems like it's waiting for something, but I don't know if it requires action on my part or not. Pressing enter simply returns another, identical line. When I Ctrl + C, it says Aborted, meaning something was clearly processing. What does this mean? For example, the following:

    $ mysql -u root -h host -p
    Enter password:
    
    Welcome to the MySQL monitor.  Commands end with ; or \g.
    Your MySQL connection id is X
    Server version: 5.1.39-log MySQL Server
    
    Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
    
    mysql> mysqldump my_database
        -> 
        -> [Ctrl + C]
        -> Aborted
    $
    

    Edit: Seems this is faulty syntax for the command, but I'm not sure that is the reason for the arrows.

  • Dennis Williamson
    Dennis Williamson almost 14 years
    In this particular case, it's not the shell that's waiting - it's mysql. However, you are otherwise correct.
  • Unfundednut
    Unfundednut almost 14 years
    To add further the way you can tell a command, atleast in mysql, is unfinished you did not end with a ';'
  • ghoppe
    ghoppe almost 14 years
    @Dennis Sorry for my imprecise wording - Technically, it is a "SQL shell" (see dev.mysql.com/doc/refman/5.1/en/mysql.html) but yes, it's not the bash/zsh unix shell… I will edit my answer.
  • Amalgovinus
    Amalgovinus over 7 years
    Great, but how do I get out of "->" ? Semicolon doesn't work.
  • Michał Miszczyszyn
    Michał Miszczyszyn almost 5 years
    @Amalgovinus try \d ; first