You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何解决Redis中spoon err: Permission Denied权限拒绝错误?

Fixing Redis BGSAVE "Permission denied" Error on Windows 10 Pro (Pre-2.8.0 Version)

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\Redis or 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 dir directive—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 dir path to a permission-friendly folder

    1. Create a new folder (e.g., C:\Redis\data)—make sure it’s outside restricted folders like Program Files if possible.
    2. In redis.conf, change the dir line to:
      dir "C:/Redis/data"
      
      (Use forward slashes or double backslashes C:\\Redis\\data for Windows paths.)
    3. Save the config file, then restart the Redis service (open services.msc, find Redis, right-click → Restart).
  • Option 2: Grant write permissions to the existing directory

    1. Open services.msc (press Win+R, type services.msc and 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.
    2. Navigate to the directory specified by dir, right-click → Properties → Security tab.
    3. Click Edit → Add, then add the Redis service user (if it’s Local System, search for NT AUTHORITY\SYSTEM).
    4. Check the Write and Modify permissions for this user, then save changes. Restart the Redis service afterward.

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.exe file 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 BGSAVE still fails, try running the SAVE command (foreground save) in the Redis CLI. If SAVE works, 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

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.06 10:43:12