SQLite Installation
An important feature of SQLite is that it is zero-configuration, which means no complex installation or management is required. This chapter will explain installation and setup on Windows, Linux, and Mac OS X.
Installing SQLite on Windows
-
Please visit SQLite download page, download the precompiled binaries from the Windows section.
-
You need to download the sqlite-tools-win32-*.zip and sqlite-dll-win32-*.zip zip file.
-
Create the folder C:/sqlite, and unzip the above two zip files into this folder, you will get the files sqlite3.def, sqlite3.dll, and sqlite3.exe.
-
Add C:/sqlite to the PATH environment variable, and finally, at the command prompt, use the sqlite3 command, 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>
Installing SQLite on Linux
Currently, almost all versions of the Linux operating system come with SQLite. So, simply use the following command to check whether SQLite is 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 do not see the above result, it means SQLite is not installed on your Linux machine. So, let's install SQLite by following the steps below:
-
Please visit SQLite download page, download from the source code section sqlite-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 your Linux machine, and you can verify it as explained above.
Installing SQLite on Mac OS X
The latest version of Mac OS X comes with SQLite pre-installed, but if no installation is available, just follow the steps below:
-
Please visit SQLite download page, download from the source code section sqlite-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 your Mac OS X machine, and you can verify with 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, practice using SQLite commands.