Error: unable to open database in macOS Mojave


sqlite3 ~/Library/Mail/V6/MailData/Envelope\ Index vacuum;
Error: unable to open database "/Users/Me/Library/Mail/V6/MailData/Envelope Index": 
unable to open database file

This happened after upgrading to Mojave.

Best Answer

I was having this issue and solved it before posting the question. I was also having other quirky permissions issues within Terminal after upgrading to Mojave.

I stumbled upon this and thought I would share here, since I don't normally consult the more casual Mac user pages: Fix Terminal “Operation not permitted” Error in MacOS Mojave

Basically, you need to add to have Full Disk Access within System Preferences -> Security & Privacy -> Privacy tab.