SQLite is a super small SQL database engine. It is self-contained within 1 single file and doesn't require any configuration. It is mostly used as an embedded database. In this tutorial, I will show you how to install and setup SQLite in MS Windows.
Download the latest version
- Go to https://www.sqlite.org/download.html.
- From the Precompiled Binaries for Windows section, download the zip file that contains the bundle of command-line tools for managing SQLite database files(e.g. sqlite-tools-win32-x86-3290000.zip).
- Unzip the file.
Setup the environment variable
After you unzip the file, you can use SQLite right away by executing sqlite3.exe but you have to first go to the directory where sqlite3.exe is located and then execute it from there. In order to run SQLite anywhere from the command line, add the directory path to the PATH environment variable. Here is how to do it.
MS Windows 10
- Press Windows key + q to search for environment term.
- Select Edit the system environment variable. The System Properties window will open.
- At the bottom right, click on Environment Variables... button.
- Under the User variables for
section, select Path and click on Edit... button.
- Click on the New button to add the directory path where sqlite3.exe is located.
Open your command prompt and execute sqlite3.exe. It should show something like the following.
C:\Users\xuan.ngo>sqlite3 SQLite version 3.29.0 2019-07-10 17:32:03 Enter ".help" for usage hints. Connected to a transient in-memory database. Use ".open FILENAME" to reopen on a persistent database. sqlite>
To quit SQLite console, execute