error: unable to read database header

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

error: unable to read database header

Alexander Gabriel
Hi

I downloaded the files for v3.29.0 into a folder.
Then double clicked sqlite3.exe to open a command shell.
Then typed `.open test.db`
Then typed `.dbinfo`
And got: `unable to read database header`

What am I doing wrong?
Have I created a broken database?

Alex
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: error: unable to read database header

David Raymond
When you run ".open test.db" if the database doesn't already exist, then the file is created. However *no data is written yet* as there are a few permanent things you could change at the very start (like page size, encoding, etc), so it holds off on writing the first page with the header until you issue some sort of statement that isn't setting those "new database options" So since the file is still 0 size at this point, there is no header for .dbinfo to read from. If you create a table first for example, then it will populate the header and actually write to the file, at which point there will be a header for .dbinfo to read.


-----Original Message-----
From: sqlite-users <[hidden email]> On Behalf Of Alexander Gabriel
Sent: Friday, August 30, 2019 10:54 AM
To: [hidden email]
Subject: [sqlite] error: unable to read database header

Hi

I downloaded the files for v3.29.0 into a folder.
Then double clicked sqlite3.exe to open a command shell.
Then typed `.open test.db`
Then typed `.dbinfo`
And got: `unable to read database header`

What am I doing wrong?
Have I created a broken database?

Alex
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users