SQLite Forum

Question .open chinook.db

Question .open chinook.db

(1) By anonymous on 2021-04-09 14:17:01 [link] [source]

Hi I am completly new to sqlite.

I need your help please: When i open my database file with .open chinook.db

and check the database with .databases i get C:WINDOWSsystem32chinook.db r/w

But .tables for example doenst work. No command works. :/

Thank you very much :)

(2) By Larry Brasfield (larrybr) on 2021-04-09 14:42:15 in reply to 1 [link] [source]

Based on this,

and check the database with .databases i get C:WINDOWSsystem32chinook.db r/w

, I assume that you are using the sqlite3 (or sqlite3.exe) CLI shell and have a SQLite database opened. But this,

But .tables for example doenst work.

suggests to me that the database is empty (and you would only consider it to have worked if you had seen a non-empty response.)

As for

No command works. :/

, I expect that is merely a deviation from your expectation. I cannot guess what commands you entered to get disappointing results and cannot comment upon what you saw except to say that to get help here you should: Show what you did; show what happened; and where not obvious, why you think that is not an example of "working".

In this case, it would also be helpful (toward anybody's effort to help you) if you were to provide a link to the database or state how to obtain it. Just because something is named chinook.db does not mean it is a database containing the tables for which that name is somewhat well known.

(3) By anonymous on 2021-04-09 14:59:36 in reply to 2 [link] [source]

Thank you for your reply. Basically the file is from my university and its not empty. I just check that :)

I just tried a workaround from my prof but I didn't work eather :/

C:UsersPDesktopSQLITE>"C:Program Files (x86)SQLITEsqlite3.exe" SQLite version 3.35.2 2021-03-17 19:07:21 Enter ".help" for usage hints. Connected to a transient in-memory database. Use ".open FILENAME" to reopen on a persistent database. sqlite> .open chinook.db sqlite> .tables sqlite> .databases main: C:UsersPDesktopSQLITEchinook.db r/w

(5) By anonymous on 2021-04-09 15:21:22 in reply to 3 [link] [source]

If you launched SQLite with the following command:

"C:Program Files (x86)\SQLITE\sqlite3.exe"

from the command prompt whose prompt is


SQLite is looking at the location of the path shown by the command prompt and will have created an empty chinook.db there.


Open the command prompt at the location where your non-empty chinook.db is.

(4) By anonymous on 2021-04-09 15:15:23 in reply to 2 [source]

I just installed SQLITE on my other Computer. On this one it is working. So problem is kind of sovled. Thank you so much :)

(6) By Simon Slavin (slavin) on 2021-04-10 12:10:47 in reply to 1 [link] [source]

You're not specifying the path of your database. When SQLite tries to open a file in the default path, it finds no file with that name, so it creates a new database for you. Obviously, the new database file has no tables in it.

To make this work as you expect, specify the correct path in your .open command, or start the SQLite command line app with the default path the directory your database file is in.