Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

create new sqlite Db

Tags:

sqlite

I am working on Mac OS X, I want to create a new SQLite DB, and I am using http://www.sqlite.org/quickstart.html as a reference.

I am entering: sqlite3 test.db and getting the response:

SQLite version 3.6.12
Enter ".help" for instructions
Enter SQL statements terminated with a ";"

Why is this happening?

like image 200
iddober Avatar asked Apr 13 '10 13:04

iddober


2 Answers

It worked. Quit out and test - the database has been created.

You are now in the SQLite shell, and it is ready to receive commands like CREATE TABLE..., INSERT INTO..., etc.

If you would prefer not to use the interactive shell, you can build your schema straight from the command line:

sqlite3 test.db "CREATE TABLE ..."

Or just create an empty database with no schema:

sqlite3 test.db ""

But that's the same as just creating an empty file, anyway:

touch test.db
like image 70
Matchu Avatar answered Sep 21 '22 15:09

Matchu


Because that is the administrative shell prompt. The shell created test.db and is now waiting for you to do something with it thus the sqlite> prompt you see.

You may want to create table ... at this point.

like image 23
msw Avatar answered Sep 20 '22 15:09

msw