Why you cannot open chat.db on a Mac (Operation not permitted)
You cannot open chat.db because macOS privacy protection blocks apps, including Terminal, from reading the Messages folder unless you grant them Full Disk Access. Add the app in System Settings, Privacy & Security, Full Disk Access, then quit and reopen it and try again.
What the error looks like
- In Terminal: "Operation not permitted" or "authorization denied" when you run ls or sqlite3 on ~/Library/Messages/chat.db.
- In Finder: a message that you do not have permission.
- In an app: an empty list or a prompt to allow access.
The fix
- Open System Settings, Privacy & Security, Full Disk Access.
- Switch on the app that needs to read the file (Terminal if you use the command line, or an export app).
- Quit the app fully and open it again.
- Try the read again.
Other reasons it can fail
- The Mac has no Messages data because Messages in iCloud is off and nothing was synced.
- Messages is open and holding the database; copy it only when Messages is closed.
- A managed Mac blocks Full Disk Access with a profile.
- The file is there but text appears blank, because newer macOS versions store message text in a binary field.
If you just want the texts
Reading a database yourself gives you rows, not a record. TextExhibit turns the same file into a PDF with names, times to the second, photos and a hash manifest, and it only reads, never writes.
What changes with each macOS version
The protection has been in place since macOS Mojave and has grown stricter in later releases. On Sonoma, Sequoia and Tahoe, the same rule applies: only an app you have listed under Full Disk Access can read the Messages folder. If a how-to written years ago tells you to simply run a command, the command will now fail until your terminal or app is on that list.
A safer approach for most people
- Use an app built for this and give it access, instead of opening the database by hand.
- If you do open it by hand, work only on a copy.
- Remember to turn Full Disk Access off for Terminal when you finish.
What to keep in mind
- Full Disk Access is broad. Turn it off when you are done. See removing it.
- Never use sudo to get around the protection; it does not bypass it for most modern macOS settings.
- Copying chat.db to a USB stick leaves private data lying around.
Questions
Does Full Disk Access change my messages?
No. It only lets an app read files.
Can I turn off the protection?
It is a system privacy feature (TCC). You grant access per app instead of turning it off.
Why does Terminal need it separately?
macOS tracks permission per app, so Terminal needs its own entry.
Sources
- Set up Messages on Mac (Apple) (checked November 15, 2026)
Export the whole conversation
TextExhibit turns a conversation into one PDF with exact times, names and numbers, photos in place and page numbers, on your Mac. Free to preview; $24.99 once to export.