title: How do you clear an unexecuted MySQL query from the command line?
body: <p>Suppose you're typing a command line query into a MySQL database and you need to cancel out and start over. From a bash shell you could just type ctrl-c and get a new prompt. In MySQL, ctrl-c would exit the client and return you to the shell. </p>
  
  <p>For example, I have a long, complex SELECT statement typed in but I haven't yet hit return. I realize that I don't want to send the command but I want to have the command on-screen so I can use it as a reference. I'd like to bail out without quitting MySQL. Any ideas?</p>
  
  <p>Key point: <a href="https://stackoverflow.com/questions/498344/how-do-i-interupt-a-long-query-in-the-mysql-command-line-tool-without-quitting-m">the command hasn't yet been executed</a>.</p>