Independent guide & tools · Not affiliated with DB Browser for SQLite

All tutorials

Fix SQLite database is locked errors

Understand locks and avoid unsafe database changes.

Step-by-step instructions

  1. Check whether another application or transaction is using the database.
  2. Close unnecessary connections and finish pending transactions. Do not forcibly delete journal or WAL files.
  3. Retry the operation after the writer finishes. In your own application, consider a suitable busy timeout and shorter transactions.
  4. If the database belongs to a running service, use its supported backup or maintenance workflow.

SQL example

Adapt example table names to your database.

PRAGMA busy_timeout = 5000;

Try the online SQLite viewer · Desktop installation guide