// SQLite error reference

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
Error message
access permission denied

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

  1. Create the database in a directory the process fully owns, such as the application's data directory.

  2. 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

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.

// fewer errors, faster fixes

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.