SQLite Installation

An important feature of SQLite is that it is zero-configuration, meaning no complex installation or management is needed. This chapter will cover installation settings on Windows, Linux, and Mac OS X.

Install SQLite on Windows

  • Please visit theSQLite download page, and download the precompiled binaries from the Windows section.

  • You need to download thesqlite-tools-win32-*.zipandsqlite-dll-win32-*.zipcompressed files.

  • Create a folder C:\sqlite, and extract the above two compressed files under this folder. You will get sqlite3.def, sqlite3.dll, and sqlite3.exe files.

  • Add C:\sqlite to the PATH environment variable, and finally at the command prompt, use thesqlite3command, which will display the following result.

C:\>sqlite3
SQLite version 3.7.15.2 2013-01-09 11:53:05
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite>

Install SQLite on Linux

Currently, almost all versions of the Linux operating system come with SQLite. So just use the following command to check whether SQLite is already installed on your machine.

$ sqlite3
SQLite version 3.7.15.2 2013-01-09 11:53:05
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite>

If you don't see the above result, it means SQLite is not installed on your Linux machine. Therefore, let's install SQLite by following the steps below:

  • Please visit theSQLite download page, and download from the source code sectionsqlite-autoconf-*.tar.gz。

  • The steps are as follows:

$ tar xvzf sqlite-autoconf-3071502.tar.gz
$ cd sqlite-autoconf-3071502
$ ./configure --prefix=/usr/local
$ make
$ make install

The above steps will install SQLite on a Linux machine, and you can verify it as described above.

Install SQLite on Mac OS X

The latest versions of Mac OS X come with SQLite preinstalled, but if there is no available installation, just follow the steps below:

  • Please visit theSQLite download page, and download from the source code sectionsqlite-autoconf-*.tar.gz。

  • The steps are as follows:

$ tar xvzf sqlite-autoconf-3071502.tar.gz
$ cd sqlite-autoconf-3071502
$ ./configure --prefix=/usr/local
$ make
$ make install

The above steps will install SQLite on a Mac OS X machine, and you can verify it using the following command:

$ sqlite3
SQLite version 3.7.15.2 2013-01-09 11:53:05
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite>

Finally, at the SQLite command prompt, use SQLite commands to practice.

Other Extensions