2011-09-23 52 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