无法使用sqlite命令bash在Python中打开Sqlite数据库创建

问题描述 投票:9回答:1

因此,如果我使用sqlite3软件包在Python中创建数据库:

import sqlite3
con = sqlite3.connect('test.db')

我无法使用bash中的sqlite命令行打开数据库:

sqlite test.db
Unable to open database "test": file is encrypted or is not a database

但是我可以在Python中使用sqlite3连接到使用sqlite命令行创建的数据库。

如何在sqlite命令行中打开Python创建的数据库?

python sqlite
1个回答
18
投票

安装sqlite3并在bash中使用sqlite3 test.db

© www.soinside.com 2019 - 2024. All rights reserved.