0
SQLite version 3.8.0.2 2013-09-03 17:11:13
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> $sqlite3 DatabaseName.db;
Error: near "$sqlite3": syntax error
sqlite> DatabaseName.db;
Error: near "DatabaseName": syntax error
sqlite> sqlite3 DatabaseName.db;
Error: near "sqlite3": syntax error
sqlite>

I am trying to create a database in SQLite. I am getting the error as above. Please help

Abhijeet Limaye
  • 117
  • 3
  • 8

1 Answers1

13

sqlite3 DatabaseName.db is what you'd use at the command line, not once you've already started the shell. Running that at command line will open it in the shell with the empty database already open.

When your prompt is sqlite>, you're already in the shell.

Here are some docs: http://sqlite.org/sqlite.html

Tom Kerr
  • 10,444
  • 2
  • 30
  • 46