-2

I don't know what's wrong with MySQL. I'm on Debian, and no matter what command I enter, like CREATE DATABASE or USE it just jumps to a newline, showing a ->. What could be wrong here?

4
  • Did you remember to terminate your SQL commands with ;? Dec 7, 2019 at 8:10
  • 1
    show us what you did Dec 7, 2019 at 8:11
  • @StéphaneChazelas Well, I'm stupid! Thanks a lot. Dec 7, 2019 at 8:15
  • If the posted answer has addressed your issue please do remember to accept it with the tick mark on its left side. Dec 7, 2019 at 8:56

1 Answer 1

3

SQL queries can an are often written on several lines as they can easily get lengthy. So the newline character in SQL is just another form of whitespace and queries have to be terminated by a semi-colon (;).

So until you enter that ;, the query is not terminated and if you press Enter, mysql reminds you so by issuing a secondary prompt.

1
  • I'm having the same problem but I know I'm terminating the lines with a semicolon.
    – Gunslinger
    Jun 22, 2023 at 2:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .