What does an arrow ("->") symbol mean on the command line?
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;
Related videos on Youtube
Josh Leitzel
Ruby ± Rails, JavaScript | CoffeeScript | Angular I can be contacted at [email protected]. Twitter GitHub Blog
Updated on September 17, 2022Comments
-
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 ICtrl + C
, it saysAborted
, 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 almost 14 yearsIn this particular case, it's not the shell that's waiting - it's mysql. However, you are otherwise correct.
-
Unfundednut almost 14 yearsTo add further the way you can tell a command, atleast in mysql, is unfinished you did not end with a ';'
-
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 over 7 yearsGreat, but how do I get out of "->" ? Semicolon doesn't work.
-
Michał Miszczyszyn almost 5 years@Amalgovinus try
\d ;
first