2.3. The mysql Prompts


2.3. The mysql Prompts

The mysql> prompt displayed by mysql is just one of several different prompts that you might see when entering queries. Each type of prompt has a functional significance because mysql varies the prompt to provide information about the status of the statement you're entering. The following table shows each of these prompts.

Prompt

Meaning of Prompt

mysql>

Ready for new statement

->

Waiting for next line of statement

'>

Waiting for end of single-quoted string

">

Waiting for end of double-quoted string or identifier

`>

Waiting for end of backtick-quoted identifier

/*>

Waiting for end of C-style comment


The mysql> prompt is the main (or primary) prompt. It signifies that mysql is ready for you to begin entering a new statement.

The other prompts are continuation (or secondary) prompts. mysql displays them to indicate that it's waiting for you to finish entering the current statement. The -> prompt is the most generic continuation prompt. It indicates that you have not yet completed the current statement, for example, by entering ';' or \G. The '>, ">, and `> prompts are more specific. They indicate not only that you're in the middle of entering a statement, but that you're in the middle of entering a single-quoted string, a double-quoted string, or a backtick-quoted identifier, respectively. When you see one of these prompts, you'll often find that you have entered an opening quote on the previous line without also entering the proper closing quote.

If in fact you have mistyped the current statement by forgetting to close a quote, you can cancel the statement by entering the closing quote followed by the \c clear-statement command.

The /*> prompt indicates that you're in the middle of entering a multiple-line C-style comment (in /* ... */ format).



MySQL 5 Certification Study Guide
MySQL 5.0 Certification Study Guide
ISBN: 0672328127
EAN: 2147483647
Year: 2006
Pages: 312

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net