download slqlit3
to download slqlit3
go to this url: https://www.sqlite.org/download.html
since your are working on windows
platform, under Precompiled Binaries for Windows section download sqlite-tools-win64-x64-3320300.zip
or sqlite-tools-win32-x86-3320300.zip
if your are like me working on the very OLD windows 7 32bit
architecture
you have to know sqlite3
is a standalone and executable file meaning sqlite3
don't require to be installed like other programs:
A bundle of command-line tools for managing SQLite database files, including the command-line shell program, the sqldiff.exe program, and the sqlite3_analyzer.exe program.
unzip the downloaded file the under C:\
for e.g. and rename the folder to C:\sqlite3
to make things simple.
now, if you open : C:\sqlite3
, you'll find 3 executable files:
C:\sqlite3
sqldiff.exe
**sqlite3.exe**
sqlite3_analyzer.exe
add an Environment Variable
- open
System Properties
(see this post)
- go to
Advanced
tab under System Properties
and click Environment Variables
- Under
System Variables
create those variables:
PYTHON_HOME
= C:\Python37
(it depends where you already installed python and which version if you have multiple installations)
SQLITE_HOME
= C:\sqlite3
- go to
User variables
and add/append variables to PATH
like so:
PATH
= [..];%PYTHON_HOME%;%PYTHON_HOME%\Scripts;
open new console and check your current active python:
python --version
and then you can use sqlite3
command not sqlite
(check the C:\sqlite3
installation folder):
(env) E:\Python installation\myproject\myflaskproject>sqlite
'sqlite' is not recognized as an internal or external command,
operable program or batch file.
(env) E:\Python installation\myproject\myflaskproject>sqlite3 -version
3.15.2 2016-11-28 19:13:37 bbd85d235f7037c6a033a9690534391ffeacecc8
now you can open the sqlite
database file (e.g: data-dev.sqlite3
under /myflaskproject
) like
(env) E:\Python installation\myproject\myflaskproject>sqlite3 data-dev.sqlite3
SQLite version 3.15.2 2016-11-28 19:13:37
Enter ".help" for usage hints.
sqlite>
some quick useful sqlite
commands
sqlite> .databases
seq name file
--- --------------- ----------------------------------------------------------
0 main E:\Python installation\myproject\myflaskproject\data-dev.sqlite3
sqlite> .tables
user
sqlite> .exit (to exit)
for more about sqlite
have look at this site sqlitetutorial.net