如何解决Redis中spoon err: Permission Denied权限拒绝错误?
Hey there! I’ve helped troubleshoot a bunch of Redis permission issues on Windows, so let’s walk through how to fix this step by step.
First, let’s address the basics: you mentioned you aren’t sure how to edit the redis.conf file—let’s start there, since that’s key to resolving the save directory permissions.
Step 1: Locate and Edit the Redis Configuration File
- Find your Redis installation folder (common paths are
C:\Program Files\Redisor a custom directory you chose during setup). - Right-click
redis.conf, select Open with, and use Notepad, VS Code, or any text editor. If you get a permission prompt when opening, right-click your editor first, choose Run as administrator, then open the config file from within the editor. - Look for the
dirdirective—it specifies where Redis saves its RDB files. By default, it’s set to.(the current working directory of the Redis server). This is often the root cause of permission issues, since the Redis service might not have write access to that folder.
Step 2: Fix Directory Permissions for RDB Saves
You have two options here, either works:
Option 1: Update the
dirpath to a permission-friendly folder- Create a new folder (e.g.,
C:\Redis\data)—make sure it’s outside restricted folders likeProgram Filesif possible. - In
redis.conf, change thedirline to:
(Use forward slashes or double backslashesdir "C:/Redis/data"C:\\Redis\\datafor Windows paths.) - Save the config file, then restart the Redis service (open
services.msc, find Redis, right-click → Restart).
- Create a new folder (e.g.,
Option 2: Grant write permissions to the existing directory
- Open
services.msc(press Win+R, typeservices.mscand hit Enter), find your Redis service, right-click → Properties → Log On tab. Note whether it’s running as the Local System account or a specific user. - Navigate to the directory specified by
dir, right-click → Properties → Security tab. - Click Edit → Add, then add the Redis service user (if it’s Local System, search for
NT AUTHORITY\SYSTEM). - Check the Write and Modify permissions for this user, then save changes. Restart the Redis service afterward.
- Open
Step 3: Pre-2.8.0 Redis Specific Checks
Since your Redis version is older than 2.8.0, there’s an extra thing to verify:
- Ensure the
redis-check-dump.exefile exists in your Redis installation folder. Older Windows builds of Redis rely on this tool for background saves, and if the service user can’t access it, it might throw permission-like errors. - If
BGSAVEstill fails, try running theSAVEcommand (foreground save) in the Redis CLI. IfSAVEworks, the issue is specifically with the background fork process—double-check that the service user has permissions to create child processes and write to the save directory.
Verifying the Fix
After making changes, run BGSAVE in the Redis CLI again. If it works, you’ll see a message like Background saving started. If not, check the Redis server logs again for updated error details—they’ll help narrow down any remaining issues.
内容的提问来源于stack exchange,提问作者Guy_g23

