Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Exit a SQLite 3 database

Tags:

sqlite

I have an SQLite 3 database in SUSE Linux.

It's stuck at the command prompt like so:

sqlite> q    ...> exit    ...> .exit    ...> quit    ...> .quit 

How do I exit out of the database?

like image 307
Harry Boy Avatar asked Jan 12 '16 15:01

Harry Boy


People also ask

How do I exit SQLite 3?

Terminate the sqlite3 program by typing your system End-Of-File character (usually a Control-D). Use the interrupt character (usually a Control-C) to stop a long-running SQL statement.

How do you exit Dbshell?

You can just hit the key combination Ctrl + C .

How do I access SQLite database in terminal?

Open a command prompt (cmd.exe) and 'cd' to the folder location of the SQL_SAFI. sqlite database file. run the command 'sqlite3' This should open the SQLite shell and present a screen similar to that below.


1 Answers

Type ; + Enter to terminate the current statement (will give an error message because what you typed so far is not a valid statement but never mind). Then .quit + Enter.

Note that in SQLite 3, SQL statements must be terminated with a delimiter, which is ; by default. The non-SQL commands, which start with a ., do not need to be terminated this way, but they are considered complete as soon as Enter is pressed.

If a command does not start with a . and Enter is pressed without the SQL termination character, the CLI client displays the "continuation prompt" (...> in your case) and expects the SQL command to be continued on the following line(s) until it is properly terminated.

See also Command Line Shell For SQLite.

like image 144
JimmyB Avatar answered Sep 17 '22 11:09

JimmyB