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:
datasoft@datasoft-linux:~$ sudo apt-get install sqlite3 libsqlite3-dev
[sudo] password for datasoft:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
sqlite3-doc
The following NEW packages will be installed:
libsqlite3-dev sqlite3
0 upgraded, 2 newly installed, 0 to remove and 350 not upgraded.
Need to get 471 kB of archives.
After this operation, 1,558 kB of additional disk space will be used.
Get:1 http://in.archive.ubuntu.com/ubuntu/ trusty/main libsqlite3-dev i386 3.8.2-1ubuntu2 [442 kB]
Get:2 http://in.archive.ubuntu.com/ubuntu/ trusty/main sqlite3 i386 3.8.2-1ubuntu2 [28.4 kB]
Fetched 471 kB in 9s (50.5 kB/s)
Selecting previously unselected package libsqlite3-dev:i386.
(Reading database ... 166551 files and directories currently installed.)
Preparing to unpack .../libsqlite3-dev_3.8.2-1ubuntu2_i386.deb ...
Unpacking libsqlite3-dev:i386 (3.8.2-1ubuntu2) ...
Selecting previously unselected package sqlite3.
Preparing to unpack .../sqlite3_3.8.2-1ubuntu2_i386.deb ...
Unpacking sqlite3 (3.8.2-1ubuntu2) ...
Processing triggers for man-db (2.6.7.1-1) ...
Setting up libsqlite3-dev:i386 (3.8.2-1ubuntu2) ...
Setting up sqlite3 (3.8.2-1ubuntu2) ...
datasoft@datasoft-linux:~$
Download Install SQLite3 from Source Code in Ubuntu
datasoft@datasoft-linux:~/sqlite$ sudo wget http://www.sqlite.org/2014/sqlite-autoconf-3080500.tar.gz
datasoft@datasoft-linux:~/sqlite$ tar -xzvf sqlite-autoconf-3080500.tar.gz
// You may end up receiving a "SQLite header and source version mismatch" error message after you finished installation if you run ./configure command.
To avoid this you may run the following ./configure command
datasoft@datasoft-linux:~/sqlite/sqlite-autoconf-3080500$ ./configure --disable-dynamic-extensions --enable-static --disable-shared
datasoft@datasoft-linux:~/sqlite/sqlite-autoconf-3080500$ make
datasoft@datasoft-linux:~/sqlite/sqlite-autoconf-3080500$ sudo make install
datasoft@datasoft-linux:~$
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:
F:\sqlite>sqlite3
SQLite version 3.8.5 2014-06-04 14:06:34
Enter ".help" for usage hints.
Connected to a transient in-memory database.
Use ".open FILENAME" to reopen on a persistent database.
sqlite> .open test1.db
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
It will be nice if you may share this link in any developer community or anywhere else, from where other developers may find this content. Thanks.
https://w3resource.com/sqlite/sqlite-download-installation-getting-started.php
- Weekly Trends and Language Statistics
- Weekly Trends and Language Statistics