启动redis失败,报错并解决

报错如下所示:
PS I:\Redis-x64-3.2.100> I:\Redis-x64-3.2.100\redis-server.exe
[27804] 31 Jul 18:12:05.902 # Warning: no config file specified, using the default config.
In order to specify a config file use I:\Redis-x64-3.2.100\redis-server.exe /path/to/redis.conf
[27804] 31 Jul 18:12:05.912 # Creating Server TCP listening socket *:6379: listen: Unknown error
情景:
开始启动redis的方式为,通过按住shift键,鼠标右键选择“在此处打开Powershell窗口”,拖动可执行文件redis-server.exe到刚打开的窗口中,再按enter键,如下图
启动redis失败,报错并解决
文章图片

【启动redis失败,报错并解决】
第一次启动成功,并保证项目运行了;第二次就报错了,如上面的错误提示;
解决方式为:
打开cmd命令行,输入:
D:\software\Redis-x64-3.2.100>redis-server redis.windows.conf
其中redis.windows.conf是redis的配置文件。
因为错误提示为,没有找到相应的配置文件:redis.conf;那就用解压后的这个配置文件。
按enter键后,启动成功。

    推荐阅读