Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Create sqlite3 database at prompt

Tags:

I tried using the following commands to create a database file at prompt, but none of them would work.

$ sqlite3 test.db sqlite3 test.db test.db 

does it require a semi-colon at the end or is it that hard to create a database file using sqlite3 prompt?

Edit:

When I start the sqlite3 prompt, I get

SQLite version 3.6.22 Enter ".help" for instructions Enter SQL statements terminated with a ";" sqlite> 

when type "sqlite3 test.db" I get,

SQLite version 3.6.22 Enter ".help" for instructions Enter SQL statements terminated with a ";" sqlite> sqlite3 test.db    ...> 

where should be the test.db file on the disk?

like image 218
user15432 Avatar asked May 05 '10 06:05

user15432


People also ask

How do I start SQLite from command prompt?

Open a command prompt (cmd.exe) and 'cd' to the folder location of the SQL_SAFI. sqlite database file. run the command 'sqlite3' This should open the SQLite shell and present a screen similar to that below.

How do I create a database in SQLite GUI?

To create a new database using DB Browser, simply click New Database to create a database for your data, give the database an appropriate name, and put it in the folder that you're using for your work on the project. You are then able to import data, create tables or indices as required.

How do you create a DB file?

Create a blank databaseOn the File tab, click New, and then click Blank Database. Type a file name in the File Name box. To change the location of the file from the default, click Browse for a location to put your database (next to the File Name box), browse to the new location, and then click OK. Click Create.


1 Answers

If you want a blank .db file just use:

touch stuff.db 
like image 69
Oswaldo Ferreira Avatar answered Sep 21 '22 02:09

Oswaldo Ferreira