Opening database file from within SQLite command-line shell

后端 未结 8 1130
时光说笑
时光说笑 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 21:46

    I wonder why no one was able to get what the question actually asked. It stated What is the command within the SQLite shell tool to specify a database file?

    A sqlite db is on my hard disk E:\ABCD\efg\mydb.db. How do I access it with sqlite3 command line interface? .open E:\ABCD\efg\mydb.db does not work. This is what question asked.

    I found the best way to do the work is

    • copy-paste all your db files in 1 directory (say E:\ABCD\efg\mydbs)
    • switch to that directory in your command line
    • now open sqlite3 and then .open mydb.db

    This way you can do the join operation on different tables belonging to different databases as well.

提交回复
热议问题