sqlite學習筆記2:建立資料庫,sqlite學習筆記

來源:互聯網
上載者:User

sqlite學習筆記2:建立資料庫,sqlite學習筆記

在上一次筆記中最後產生了一個sqlite可執行檔,cd到sqlite所在的目錄下面執行:

sqlite3 MyDataBase.db

就會建立了一個名叫MyDataBase.db的資料庫,在當前路徑下面就會產生一個叫MyDataBase.db的檔案

#切記不是先運行sqlite3,然後再上述命令,而是在終端直接輸入上述命令,否則會報錯:Error: near "sqlite3": syntax error

然後運行命令:

.databases
可以查看剛剛建立的資料庫,退出資料庫命令列使用如下命令:

.quit


另外可以使用命令:

.help

查看協助






sqlite建立資料庫問題?

在進入sqlite>之前使用sqlite3 d:/test.db
C:\Windows\system32>sqlite3 test.db
 
怎在sqlite裡建立一個資料庫

直接在命令列下輸入 sqlit3 +資料庫名 就可以直接建庫了
 

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.