I had a heavily corrupted MySQL database, so I tried to restore the files from a recent backup (a local time machine snapshot), but that failed with the error:
The operation can’t be completed because you don’t have permission to access some of the items.
How can I restore these files?
In trying, I added my account to the "_mysql" group with
groups now lists me as being in the "_mysql" group), which is supposed to be granted read/write access to all files and folders, and tried restoring from Time Machine again with the same result. The folders also still display the "inaccessible" icon overlay (⛔️) in Finder. I can copy (slightly) older versions of the files stored on an external Time Machine drive from a shell with a
sudo ditto, but get a permissions error from MySQLd when it tries to read one of the files (the binary log index).
The computer is running OS X 10.12.6.