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>

我正在尝试在 SQLite 中创建一个数据库。我收到上述错误。请帮忙

4

1 回答 1

13

sqlite3 DatabaseName.db是您在命令行中使用的,而不是在您已经启动 shell 之后。在命令行运行它会在 shell 中打开它,空数据库已经打开。

当您的提示符为sqlite>时,您已经在 shell 中。

这里有一些文档: http ://sqlite.org/sqlite.html

于 2013-09-19T14:51:40.387 回答