"Error: Unable to Open Database" When Creating Sqlite3 Database in Terminal
The Other Questions I've Seen Deal with This Have to Do with Creating Databses Through Django or Some Other Python Framework. I Am Simply Trying to Create a...
The other questions I've seen deal with this have to do with creating databses through Django or some other Python framework. I am simply trying to create a database with $sqlite3 database.db. It opens up the sqlite console, but when I type .schema, I get Error: unable to open database "database.db": unable to open database file, and then get booted from the database. There's no database.db file leftover.
I cannot make sense of this.
1 Answer
A database file is not created until you actually add table(s). Try adding a table using:
sqlite> create table [table name]([field] [type]);
sqlite> .quit
Then you should have a database file created.