SQLite error for creating database

走远了吗. 提交于 2019-12-13 08:20:08

问题


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


回答1:


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



来源:https://stackoverflow.com/questions/18890895/sqlite-error-for-creating-database

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!