5
votes

I am trying to create a sqlite3 database on my windows 7 64 bit machine. I have downloaded sqlite-shell-win32-x86-3071700.zip from http://www.sqlite.org/download.html . After running the sqlite3.exe on my Desktop, I ran the following:

sqlite > sqlite3 mytest.db

after I pressed enter it just printed out

... >

Unable to create sqlite3 database on windows 7 64 bit machine

I noticed someone had a similar problem has me so I tried running it through the Windows command prompt. However I still got the same output

.... >

When I use a semicolon after mytest.db I get the error the guys gets in the above link, even in the Windows command prompt.

Any help is appreciated.

Thanks in advance.

4
Run sqlite3.exe from a command prompt, not from the sqlite prompt. What do you get if you just enter sqlite3 at a Windows command prompt? - Mike Sherrill 'Cat Recall'
@Mike Sherrill 'Catcall' I actually ran it through the command promt (not the SQLite prompt) and got the same problem. Here is a screenshot of what happens what I do: img.imgcake.com/superangelo128/sqliteproblemjpgse.jpg - Angelo Rivera

4 Answers

12
votes
sqlite3 mytest.db ""

See those "" at the end - they are needed if you want to create empty database

6
votes

Your problem seems to be that you're trying to run sqlite at the sqlite prompt. Don't do that.

You just need to run SQLite3 and give it a database name at the Windows command prompt. Here's what it looks like on my computer, starting SQLite3 and creating a new database (test.db).

$ sqlite3 test.db
SQLite version 3.7.9 2011-11-01 00:52:41
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> 

At the sqlite> prompt, you can use SQLite's SQL-like language to create and manipulate database objects.

sqlite> create table test (test_id integer primary key);
sqlite> insert into test values (1);
sqlite> select * from test;
1
3
votes

Had the same problem, I was running the sqlite3.exe in Windows 10 but noticed the $ before the command given by Mike's example, so the issue was I had to 'get out' the sqlite system commands.

Just run:

.shell sqlite3 test.db

This allow you to run CMD ARGS.

Then check by doing:

.databases
0
votes

When you try to create DB if any permission issue exists then,That creation process cannot be completed.That time ...> symbol will be shown. So Solution is,In comand prompt specify the root directory where to create DB file,Example code is here,

C:> cd d:\

C:> d:

d:>cd sqlite

d:\sqlite>sqlite3 testDb.db

SQLite version 3.8.2 2013-12-06 14:53:30 Enter ".help" for instructions Enter SQL statements terminated with a ";"

sqlite> .databases

seq name file


0 main d:\sqlite\testDB.db