Cannot Open Photos on Mac, Library is Locked?

Rotten Apple
3 min readJan 15, 2022

Frustrated because your Mac Photos library won’t open? It’s easy to fix.

Can’t open Mac Photos library — permissions issue or database locked

On trying to open Photos on Mac, if you get the error alert: “Repair Library permissions. This photo library is locked or you do not have permissions to make changes to it. Photos can try to repair the permissions”, it could be because of a few different reasons. Fortunately, it’s usually easy to fix.

How to fix “Mac Photos library is locked, cannot open” error

Here are the most common causes of this problem and the solutions. Try each solution in turn, then try to open Photos — see which one works for you:

  1. Photos library corrupted: Click the Repair button in the above message box. Alternatively, hold down Command + Option keys, then click open Photos. Select the Repair option.
  2. Another program accessing the Photos database: Apple Photos stores photos and videos in a database structure (Details here). In order to avoid data conflicts or corruption, only one program at a time is allowed to use this database. Quit any other photos-related programs that are open. Also check Activity Monitor: if photolibraryd or photoanalysisd appear in the list of active processes, right click and quit them.
  3. Database lock persisting from a previous session: To prevent multiple programs from using the Photos database simultaneously, any program using it locks it. The lock is automatically released on closing the program, but if it persists, release it as follows: Find Photoslibrary.photoslibrary (It’s usually in the users/pictures folder); right click it and select Show Package Contents. In the Database folder, find files with filetype lock (e.g. Photos.sqlite.lock or photos.db.lock). Drag the lock file, as well as any wal and shm files, to the desktop. Be careful not to move or modify any other files. If you can now open Photos, trash the lock, wal and shm files.
  4. Permissions for the Photos library: Permission settings determine file access. To check or amend these, right click Photoslibrary.photoslibrary and select Get Info. At the bottom of the window that opens, expand Sharing and Permissions and change the relevant permission levels to Read and Write. See this for more details.
  5. Ownership conflict on removable drives: If your Photo Library is on an external drive used by multiple computers or Mac users, a permission dispute on that drive can lock access to it. Fix the read/write permissions to access external drives on the Mac. Apple warns not to keep the Photos library on shared external drives (e.g. NAS, like Synology). Move your library to a disk that is directly connected e.g. via USB cable, only to your Mac, and formatted as macOS Extended (Journaled) or APFS.
  6. Photo library out of space: If the drive on which Photo library resides is running out of free space, the Photo library may get locked.

Hope one of the above fixes resolve your problem and have you happily browsing your photo collection again!

— —

Running Out of Space on Your Mac, or Want to Quit Using iCloud?

The photos and videos stored in the Photos library usually account for most of the disk space usage on your Mac or your iCloud account. If your Mac is out of space and you don’t want to use iCloud, or your photos are in the iCloud Photos library and you want to get them out into normal folders, now there is an easy way to do this. Photos Takeout app exports them from the Photos and iCloud Photos library into year-wise, album-wise or date-wise folders. These can be saved on your Mac, in cloud storage like Dropbox or Google Drive, or in an external drive. Resolution, image format and metadata are all preserved.

Photos Takeout for Mac — App Home screen
Photos Takeout is available on the Mac App Store.

--

--