I'm following a beginners tutorial to sqlite3
. The first step is creating a new database. So I enter a name (movies.db
).
I'm expecting to get another sqlite>
prompt on the next line, and continue with the tutorial, but instead I get a lame ...>
after which I can type any gibbersish I want. Clearly, this is not good.
What my command prompt looks like:
SQLite version 3.8.1 2013-10-17 12:57:35
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> $ sqlite3 movies.db
...> gibberish
...> dsds
...> sdada
...> gfgys
...> a
...> Aaaaarrrgh!
...>
How do I get sqlite3 to work normally for me?
Pardon my newbie-ness. I hope I've phrased this question in a way that might help other newbs too.
I constantly hit up arrow or left arrow and get into this below. I've found that only control-D works.
Sqlite is working normally. However, the
sqlite movies.db
command should be issued from your system command line – not from the Sqlite interactive shell. Start by exiting the Sqlite interactive shell (.exit
), then issuing the database creation command.According to the quickstart documentation:
Once the
sqlite movies.db
command is properly executed from your system command line, you'll automatically be placed in the Sqlite interactive shell, which will be awaiting commands.The
...>
shell prompt indicates a continuance from the preceding line. As indicated in the message, you'll need to terminate each database command with a;
semicolon.Terminate the statement with a ;. So just hit ; then enter and it will go back to normal (after giving an error, because what you've typed here is bad sql).
What's going on is it thinks you are still working on something. It can be useful to break up long queries into lines like this:
And the ...> means it is waiting for you to finish your query, which you signify with the semicolon.
I got in the same state after hitting some arrow keys
The forward-slash character '/' seemed to solve it for me.