SQLite Installation
One of the key features of SQLite is its zero-configuration, which means it doesn't require complex setup or administration. This chapter will guide you through the installation process on Windows, Linux, and Mac OS X.
Installing SQLite on Windows
- Visit the SQLite Download Page and download the precompiled binaries from the Windows section.
- You need to download the sqlite-tools-win32-.zip and sqlite-dll-win32-.zip compressed files.
- Create a folder C:\sqlite and unzip the above two files into this folder, which will give you sqlite3.def, sqlite3.dll, and sqlite3.exe files.
- Add C:\sqlite to your PATH environment variable, and finally, in 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, just use the following command to check if 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, follow these steps to install SQLite:
- Visit the SQLite Download Page and download sqlite-autoconf-*.tar.gz from the source code section.
- Proceed as follows:
$ tar xvzf sqlite-autoconf-3071502.tar.gz $ cd sqlite-autoconf-3071502 $ ./configure --prefix=/usr/local $ make $ make install
These steps will install SQLite on your Linux machine, and you can verify it as explained above.
Installing SQLite on Mac OS X
The latest versions of Mac OS X come pre-installed with SQLite, but if it's not available, follow these steps:
- Visit the SQLite Download Page and download sqlite-autoconf-*.tar.gz from the source code section.
- Proceed as follows:
$ tar xvzf sqlite-autoconf-3071502.tar.gz $ cd sqlite-autoconf-3071502 $ ./configure --prefix=/usr/local $ make $ make install
These steps will install SQLite on your 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, practice using SQLite commands at the SQLite command prompt.