SQLite3 freezing without commandline prompt on startup in Win11 CLI
(1) By Koekhakken on 2025-01-20 12:56:22 [source]
Good afternoon, I am just starting with getting myself into SQL and I thought the installation of the seemingly light and straightforward SQLite3 would be a good place to start.
I am running a windows 11 x64 system so I downloaded the pre-compiled
sqlite-tools-win-x64-3480000.zip
from https://www.sqlite.org/download.html
Added the directory to my PATH and it should be ready to go.
However..
When I run it from powershell, I do get the expected following text:
PS C:\> sqlite3
SQLite version 3.47.2 2024-12-07 20:39:59
Enter ".help" for usage hints.
Connected to a transient in-memory database.
Use ".open FILENAME" to reopen on a persistent database.
But I do not get a sqlite>
prompt. In fact, the program seems to freeze at this moment and does not accept or echo any keyboard inputs.
The only way-out at this stage is a series of quickly repeated ^C's to interupt the program manually.
I get the same behaviour when starting from CMD
Now, when I double-click sqlite3.exe
in explorer, it opens a new instance of the terminal and then I do get the prompt and the program seems to normally respond to commands.
So the installation seems to be alright in itself but I cannot invoke it from any other terminal instance or from within VSCode.
Does anyone have the same behaviour and/or an idea what might be causing it?
Many thanks in advance!
For the sake of completeness:
SQLite 3.48.0 2025-01-14 11:05:00 d2fe6b05f38d9d7cd78c5d252e99ac59f1aea071d669830c1ffe4e8966e84010
zlib version 1.3
msvc-1939 (64-bit)
(2) By jose isaias cabrera (jicman) on 2025-01-20 14:31:50 in reply to 1 [link] [source]
I believe you have a path setting problem. If you look at the PowerShell prompt, it's for version 3.47.2. I would open a command prompt and set the appropriate path so that the 3.48.0 is picked up first. I would CD to the spot where you know the sqlite3.exe is, and run it from there.
(3) By Koekhakken on 2025-01-20 16:44:14 in reply to 2 [link] [source]
Thanks Jose.
Well spotted! indeed the program ran correctly when cd to the correct directory and ran with .\sqlite3
.
So then I further investigated and put the sqlite path at the very top of the env variables to make sure it will get checked first. And it worked! brilliant.
To narrow-down on the culprit path-element, I gradually moved the sqlite path down the list of system paths until it stopped working.
As it turns out, when I recently re-installed MinGw as my C compiler (and added the path to it), the package also contained sqlite3 rev 3.47! Now that I have deleted that old version everything works as it should!
Topic closed. Thanks a bunch once more.