SQLite无法使用密码加密来打开数据库 [英] SQLite cannot open database with password encryption
问题描述
我正在使用SQLite处理Unity项目.当我打开一个加密的数据库时,出现以下错误消息:
I am handling a Unity project using SQLite. When I open an encrypted database, the following error message shows up:
EntryPointNotFoundException:sqlite3_key Mono.Data.Sqlite.SQLite3.SetPassword(System.Byte [] passwordBytes) Mono.Data.Sqlite.SqliteConnection.Open()SQLiteHandler.Start()(在 Assets/Script/SQLiteHandler.cs:18)
EntryPointNotFoundException: sqlite3_key Mono.Data.Sqlite.SQLite3.SetPassword (System.Byte[] passwordBytes) Mono.Data.Sqlite.SqliteConnection.Open () SQLiteHandler.Start () (at Assets/Script/SQLiteHandler.cs:18)
这是我的连接代码,既没有将密码放入连接字符串中,也没有使用SetPassword
工作.
Here is my connection code, neither putting the password into connection string nor using SetPassword
work.
connString = string.Format("Data Source={0};Version=3;Password=testing123",Application.dataPath+"/demodb.db");
using (conn = new SqliteConnection (connString)) {
conn.Open ();
//do something
conn.Close ();
}
推荐答案
Mono.Data.Sqlite
不支持密码保护,它不包含两个关键入口点sqlite3_key和sqlite3_rekey.因此,最好寻找其他扩展或库.
Mono.Data.Sqlite
does not support password protection, it does not include the two critical entry points sqlite3_key and sqlite3_rekey. So, better look for other extensions or libraries.
这是一个有用的Unity包 SqlCipher4Unity 非常适合密码保护.
Here is a useful Unity package SqlCipher4Unity which fits well with password protection.
这篇关于SQLite无法使用密码加密来打开数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!