4

如果它是多余的,我深表歉意,但我似乎无法在任何地方找到答案。我使用 SQLite3 的数据库浏览器为我的数据库设置了密码(加密密钥)。它使用 sqlcipher。现在我无法访问它。我无法提供密码\密钥。这是我的代码:

import sqlite3
from Data.Item import item
import sys


conn = sqlite3.connect('maindb.db')
c = conn.cursor()
c.execute("PRAGMA KEY = 'password'")

def items():
      c.execute("SELECT * FROM Item")
      data=c.fetchall()

details=items()

我的平台是Windows。我试过pysqlcipher,它没有安装会引发错误。我该如何从这里开始?我应该怎么办?我的目标是由于一些明显的原因使我的数据库文件不可读。

我收到以下错误:c.execute("SELECT * FROM Item") sqlite3.DatabaseError: file is encrypted or is not a database

4

0 回答 0