How to Install and Use SQLite on Windows
Home
About
Articles
Unlike modern versions of macOS, SQLite isn’t installed by default on Windows. If you’re using Windows like I am, you need to complete a few extra steps before you can start using it.
Let’s begin to install SQLite on Windows by first downloading the executables from the SQLite Download Page .
You’ll want to find the section Precompiled Binaries for Windows and download one of the zip files. In this guide I’ll be using the bundle of command-line tools, simply because it’s always useful to have the additional utilities on hand.
The bundle includes the executables sqlite3.exe for managing SQLite databases, sqldiff.exe for displaying the differences between SQLite databases and sqlite3_analyzer.exe that provides information on the space utilization of SQLite databases.
Once you’ve downloaded the zip file, extract the executables into the local folder C:\sqlite
You’ve now downloaded SQLite to your local Windows environment, but you haven’t installed it yet. We could simply use the command prompt to navigate to the folder containing the executables each time we run SQLite, but who wants to do that?! Let’s actually install SQLite by editing the PATH environment variable on Windows.
Let’s begin by using the Windows Start Menu to search for “environment variables” to open the Environment Variables window located in Settings . You’ll want to locate the ‘Path’ variable and click Edit :
Within ‘Edit environment variable’ for the ‘Path’ variable, add a new entry with a value of “C:\sqlite” . This is telling Windows that if you type the name of an executable into the command prompt, it will include this path when looking for it’s location.
Once you’ve added the new variable, open a new command prompt (or Windows Terminal) and type the name of one of the executables you downloaded. In this screenshot you can see that running the command sqlite3 is able to run the executable sqlite3.exe within the folder C:\sqlite !
You’ve now got SQLite installed on Windows and are ready to manage SQLite databases!
If you’re looking to create a new database or list the databases and tables already on your local Windows environment, here are a few commands that you may find useful.
If you’d like to experiment with executing SQL statements in SQLite, why not create a new database and use the SQL statements in the following code snippets to return a result set in the command prompt?
You should now be able to manage SQLite databases on Windows!
We couldn't find any similar articles!
RSS