SQLite Download, Installation and Getting started
Introduction
SQLite does not have a separate server process like most other SQL databases. There is absolutely no configuration to start, the SQLite project provides a command-line utility named sqlite3 (or sqlite3.exe on windows) that allows the user to manually enter and execute SQL statements against an SQLite database. In this document, we have discussed an introduction on how to download, install and start the sqlite3 program.
Linux:
Download and Install SQLite3 from Ubuntu repository
Execute the following command in linux shell:
Download Install SQLite3 from Source Code in Ubuntu
Getting Started in Linux
After completion the installation process just type "sqlite3" and press "Enter" in linux shell and sqlite3 program will show a brief banner message and prompt you to enter SQL. To create a new database, type "sqlite3" followed by the name of the database file. If no database file is specified, a temporary database is created and deleted when the "sqlite3" program exits. Every SQL statement is terminated by a semicolon and press "Enter" to execute SQL. See the following commands:
datasoft@datasoft-linux:~$ sqlite3 test1 SQLite version 3.8.5 2014-06-04 14:06:34 Enter ".help" for usage hints. sqlite> .database >seq name file --- --------------- ---------------------------------------------------------- 0 main /home/datasoft/test1 sqlite> create table tb1 (col1 varchar(12), col2 intger); sqlite> insert into tb1 values ('white', 100); sqlite> insert into tb1 values ('red', 200); sqlite> select * from tb1; white|100 red|200 sqlite>.quit datasoft@datasoft-linux:~$
Install SQLite3 on Windows
- Go to SQLite3 download page.
- Go to the "Precompiled Binaries for Windows" section.
- Download "sqlite-shell" and "sqlite-dll" archive files.
- Unpack them in C:\WINDOWS\system32 folder (or any other that is in your PATH).
Getting Started in Windows
In Windows, double-clicking on the sqlite3.exe icon you can start the command-line shell. But by default this SQLite session uses an in-memory database, not a file on disk, and so all changes will be lost when the user exist the session. To use a persistent disk file as the database, enter the ".open" command immediately after the terminal window starts up:
The ".open test1.db" command open the database test1.db. To use the full pathname of a file, use forward-slashes as the directory separator character (e.g. use "d:/workarea/test.db", not "d:\workarea\test.db").
Previous:
SQLite3 Home
Next:
DOT(.) Commands