Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

share|improve this question
9  
Actually, OS X is Unix. GNU/Linux is a very similar but not directly related operating system. –  AndrejaKo Jul 5 '10 at 15:18
    
And in this specific case you probably did NOT want to execute mysql first. Just run mysqldump my_database by itself, outside of the MySQL prompt. –  Arjan Jul 5 '10 at 18:20
1  
Bash shell will do similar with an unclosed quote. –  Rob Apr 30 '12 at 18:55

3 Answers 3

up vote 12 down vote accepted

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`
share|improve this answer

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

mysqldump my_database;
share|improve this answer

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)

share|improve this answer
1  
In this particular case, it's not the shell that's waiting - it's mysql. However, you are otherwise correct. –  Dennis Williamson Jul 5 '10 at 15:53
1  
To add further the way you can tell a command, atleast in mysql, is unfinished you did not end with a ';' –  MrStatic Jul 5 '10 at 16:00
    
@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. –  ghoppe Jul 5 '10 at 17:04

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.