Opening database file from within SQLite command-line shell

后端 未结 8 1007
时光说笑
时光说笑 2021-01-29 21:07

I\'m using the SQLite Command Line Shell. As documented, I can open a database by supplying it as an argument to the executable:

sqlite3 data.db

8条回答
  •  没有蜡笔的小新
    2021-01-29 22:10

    You can attach one and even more databases and work with it in the same way like using sqlite dbname.db

    sqlite3
    :
    sqlite> attach "mydb.sqlite" as db1;
    

    and u can see all attached databases with .databases

    where in normal way the main is used for the command-line db

    .databases
    seq  name             file                                                      
    ---  ---------------  ----------------------------------------------------------
    0    main                                                                       
    1    temp                                                                       
    2    ttt              c:\home\user\gg.ite                                   
    

提交回复
热议问题