Install SQLite on Windows

As you get used to it, you'll want to run and experiment with different types of SQL. For that purpose, it is convenient to have an environment where SQL can be executed interactively. This time, let's create an environment for executing SQL on Windows.

Download libraries and command line programs

To use SQLite, you need a library to operate the database and a command line program to execute SQL. You need to get these two.

SQLite home page

The following is the SQLite home page.

SQLite site

SQLite download page

There is a link that says "Download" in the middle of the top of the homepage. Here is a link to the SQLite download page.

SQLite Download Page

Find SQLite libraries and command line programs for Windows

Go around the page looking for Windows-like SQLite libraries and command line programs. I think it says something like "For Windows". "Sqlite dll ~ .zip" is the SQLite library. "Sqlite ~ .zip" is a SQLite command line program. Let's download these two.

I will link to the latest version as of December 07, 2009.

Download these and unzip the zip file.

File placement

When you unzip the file, you will find "sqlitedll ~ .zip"

sqlite3.def

sqlite3.dll

File is

In "sqlite ~ .zip"

sqlite3.exe

I think that the file is included. sqlite3.def is needed to create a static library, so I don't need it now.

sqlite3.dll

sqlite3.exe

Place the file in your favorite directory. This time

c:\sqlite

I will place it in the directory called.

Setting the environment variable Path

Find the environment variable Path

Next, set the environment variable Path so that "sqlite3.exe" can be executed from the command prompt. Be careful when setting this path. I'm going to change the value of the environment variable Path, but if I make a mistake, there is a risk that it will not work properly. Make sure to copy the Path value and save it somewhere.

First, right-click on "My Computer" and click "Properties" in the pop-up menu. Then there is a tab called "Detailed Settings" at the top, so click on it. At the bottom of the "Advanced" tab, you'll see a button called "Environment Variable". Please click this.

When the "Environment Variable" window opens, look for the item "Path" in the "System Variable" list at the bottom.

Setting the environment variable Path

Click on the item called Path and press the "Edit" button at the bottom right. Then you can edit the value of Path, so first copy it and save it somewhere in a text file. It is safe because it can be restored.

When you're done, put the environment variable Path at the beginning

c:\sqlite; (value of the original environment variable Path)

Please add. Notice that there is a semicolon after "c:\sqlite". Once set, press OK several times to close the properties.

Confirm that the SQLite command line program can be executed

Now start the command prompt

sqlite3

Let's try. The environment variable settings will be reflected when the command prompt is restarted, so if it has already started, restart the command prompt.

If you can execute sqlite3 as shown below, you have successfully installed it.

SQLite version 3.6.20

Enter ".help" for instructions

Enter SQL statement terminated with a ";"

sqlite>

If you want to quit

.quit

will do.

Now you have an environment where you can execute SQL interactively.

Related Informatrion