content_image/705379.jpg content_image/705380.jpg
+---------------------+ 1 row in set (0.00 sec) 

A query need not be given all on a single line, so lengthy queries that require several lines are not a problem. mysql  determines where your statement ends by looking for the terminating semicolon, not by looking for the end of the input line. (In other words, mysql  accepts free-format input: it collects input lines but does not execute them until it sees the semicolon.) 

Here is a simple multiple-line statement: 

mysql> SELECT -> USER() -> , -> CURRENT_DATE; 

<img src='content_image/705379.jpg'>

In this example, notice how the prompt changes from mysql>  to ->  after you enter the first line of a multiple-line query. This is how mysql  indicates that it has not yet seen a complete statement and is waiting for the rest. The prompt is your friend, because it provides valuable feedback. If you use that feedback, you can always be aware of what mysql  is waiting for. 

If you decide you do not want to execute a query that you are in the process of entering, cancel it by typing \c : 

mysql> SELECT -> USER() -> \c mysql> 

Here, too, notice the prompt. It switches back to mysql>  after you type \c , providing feedback to indicate that mysql  is ready for a new query. 

The following table shows each of the prompts you may see and summarizes what they mean about the state that mysql  is in. 

<img src='content_image/705380.jpg'>

Multiple-line statements commonly occur by accident when you intend to issue a query on a single line, but forget the terminating semicolon. In this case, mysql  waits for more input: 

mysql> SELECT USER() -> 

