2011-09-23 60 views
4

我是SQLite的新手。我下载了最新版本的SQLite(包括shell和dll)并将它们提取到我的D:驱动器。我通过双击执行'sqlite3.exe'文件。sqlite中的语法错误试图创建数据库

当我尝试使用命令sqlite3 test.db;创建数据库时,出现此错误。

D:\Android Work\Sqlite\sqlite-shell-win32-x86-3070800>sqlite3.exe
SQLite version 3.7.8 2011-09-19 14:49:19
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> sqlite3 test.db
...> ;
Error: near "sqlite3": syntax error
sqlite>

请帮助我..

回答

11

我相信你必须在命令行提示符下键入“sqlite3的test.db的”,而不是从互动的SQLite接口内。

here

$ sqlite3 test.db 
SQLite version 3.0.8 
Enter ".help" for instructions 
sqlite> .quit 
$ 
+3

您还可以使用附加数据库命令从sqlite的外壳中创建一个新的数据库,但在这样的命令行提供它是最好的,“最干净”的选项。 – glibdud