So if I create a db in Python using the sqlite3 package:
import sqlite3
con = sqlite3.connect('test.db')
I can't open the db using the sqlite command line in bash:
sqlite test.db
Unable to open database "test": file is encrypted or is not a database
I can however connect to a db created with the sqlite command line using sqlite3 in Python.
How can I open the Python created dbs in the sqlite command line?
If you are using Linux or a Mac, open a terminal window instead a command prompt. Open a command prompt (cmd.exe) and 'cd' to the folder location of the SQL_SAFI. sqlite database file. run the command 'sqlite3' This should open the SQLite shell and present a screen similar to that below.
If SQLite is unable to open the database file, this means that the SQLite database you are trying to open is corrupted. There are various causes of corruption, such as file overwrite issues, file locking issues, database synchronization failures, storage media failures, and many more.
Install sqlite3
and use sqlite3 test.db
in bash.
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