windows環境下的redis爬坑(使用phpstudy v8.0)


 ERR Client sent AUTH, but no password is set(客戶端發送密碼驗證,但是未設置密碼)

錯誤原因:

windows環境下phpstudy啟動redis時是不會加載配置啟動的(個人驗證得出),應該用是直接調用redis-server.exe而非redis-server.exe redis.windows.conf。

所以即使在配置文件redis.windows.conf中添加了

requirepass 123456

通過phpstudy啟動的redis。在訪問設有密碼的redis服務器時便會報這個錯誤。

解決方法:

1、不通過phpstudy啟動redis。將redis加入windows服務然后設置開機啟動

redis-server --service-install redis.windows.conf  //將redis加入windows服務,並設置開機自啟(第一次加入服務需手動啟動)
redis-server --service-start  //啟動命令
redis-server --service-stop  //停止命令
redis-server --service-uninstall  //卸載命令
redis-server --service-install –service-name redisService1 –port 10001  //安裝新實例命令
結果 : redis-server --service-start –service-name redisService1

 

2、使用phpstudy設置redis。但是需每次通過命令(config set requirepass "your password")來設置密碼


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM