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.

  • 10
    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
  • → or 👉 look better. – Jonny May 13 '15 at 23:53

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

    `users`.`is_active` = 1 AND
    `users`.`age` < 13
  • Great, but how do I get out of "->" ? Semicolon doesn't work. – Amalgovinus Feb 7 '17 at 18:32
  • @Amalgovinus try \d ; first – Michał Miszczyszyn Jul 10 at 14:16

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)

  • 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 ';' – Unfundednut 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

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

mysqldump my_database;

If you use MariaDB, mysqldump is not a mysql command. Run it in the bash.

$ mysqldump -u root -h host -p ### my_database > dump.sql

To be more exact usage, run mysqldump --help.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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