I have created a database named database.db
When I create a table in the database I get the error:Error: file is not a database
nehal@nehal-Inspiron-5559:~/Desktop/UAV$ sqlite3 database.db
SQLite version 3.20.1 2017-08-24 16:21:36
Enter ".help" for usage hints.
sqlite> CREATE TABLE users(
...> password varchar(10),
...> email text,
...> name text
...> );
Error: file is not a database
How do I resolve the error?
The error can occur when a database was created with cipher.
So sqlite3_open
succeded but any sqlite3_exec
or sqlite3_prepare
will be failed with this error.
Create database without the .db
extension.
for e.g. sqlite3 users //this creates a database names users
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With