SQLITE_PERM: access permission denied
SQLite couldn't give a newly created database the access mode that was requested, for example because of file system permissions.
- Result code
SQLITE_PERM- Name
3- Category
- Primary result codes
What it means
The SQLite documentation defines SQLITE_PERM (3) narrowly: the requested access mode for a newly created database could not be provided. In practice it is rare, and permission problems on existing files usually show up as SQLITE_READONLY or SQLITE_CANTOPEN instead.
Common causes
- Creating a database in a location where the process may create the file but not with the requested mode.
- A custom VFS or sandbox (for example on mobile platforms) refusing the requested access.
How to fix it
-
Create the database in a directory the process fully owns, such as the application's data directory.
-
Check the open flags and any URI parameters such as
mode=, and make sure they match what the platform allows.
Related errors
More primary result codes errors
SQLITE_ERRORSQL logic errorSQLITE_ABORTquery abortedSQLITE_BUSYdatabase is lockedSQLITE_LOCKEDdatabase table is lockedSQLITE_NOMEMout of memorySQLITE_INTERRUPTinterruptedSQLITE_IOERRdisk I/O errorSQLITE_CORRUPTdatabase disk image is malformed
The code and message text are from the SQLite result and error codes documentation. Browse the full SQLite error list or search every database error.
Work on SQLite in SQLly
A native SQL client for macOS, Windows and Linux with schema-aware IntelliSense, guardrails for risky statements and clear error messages, for SQLite and the other databases you use.