i trying open encrypted sqlite3 database using pdo (php 7.1.1).
$db = new pdo('sqlite:mydb.sqlite','','password'); $db->setattribute(pdo::attr_errmode, pdo::errmode_exception); $results = $db->query('select * table');
the above code throws following exception:
uncaught pdoexception: sqlstate[hy000]: general error: 26 file encrypted or not database
is connection string correct? possible open encrypted sqlite3 database using pdo?
the documentation pdo sqlite interface makes no mention of encryption, nor documentation pdo class. thing i'm aware of sqlite3 class has parameter encryption key in the constructor.
per documentation:
encryption_key - optional encryption key used when encrypting , decrypting sqlite database. if sqlite encryption module not installed, parameter have no effect.
as mentioned in comments on question, there other answers address installing , getting sqlite encryption module working php.
Comments
Post a Comment