Where is SQLite database stored on disk?

后端 未结 7 809
无人及你
无人及你 2021-01-31 14:02

Where is the SQLite database stored i.e. directory path on windows 7 when created ?

相关标签:
7条回答
  • 2021-01-31 14:43

    When you call sqlite3_open() you specify the filepath the database is opened from/saved to, if it is not an absolute path it is specified relative to your current working directory.

    0 讨论(0)
  • 2021-01-31 14:44

    If you are running Rails (its the default db in Rails) check the {RAILS_ROOT}/config/database.yml file and you will see something like:

    database: db/development.sqlite3
    

    This means that it will be in the {RAILS_ROOT}/db directory.

    0 讨论(0)
  • 2021-01-31 14:47

    .databases

    If you run this command inside SQLite

    .databases
    

    it lists the path of all currently connected databases. Sample output:

    seq  name             file                                                      
    ---  ---------------  ----------------------------------------------------------
    0    main             /home/me/a.db
    
    0 讨论(0)
  • 2021-01-31 14:48

    There is no "standard place" for a sqlite database. The file's location is specified to the library, and may be in your home directory, in the invoking program's folder, or any other place.

    If it helps, sqlite databases are, by convention, named with a .db file extension.

    0 讨论(0)
  • 2021-01-31 14:52

    A SQLite database is a regular file. It is created in your script current directory.

    0 讨论(0)
  • 2021-01-31 14:56

    SQLite is created in your python directory where you installed the python.

    0 讨论(0)
提交回复
热议问题