Error report and solution when connecting to Redis

Error report and solution when connecting to Redis

  1. Problem description: Could not connect to Redis at 127.0.0.1:6379: Unable to connect because the target computer actively refused.
    Insert image description here

  2. Cause of the problem: redis startup method is incorrect

  3. solution:

    • Open the command line window in the redis root directory and enter the command redis-server.exe redis.windows.conf. Do not close this window.

      Insert image description here

    • Reopen the cmd window and enter redis-cli to execute.
      Insert image description here

  4. Three ways to start redis

    1. The default port 6379 starts: redis-server
    2. Start on the specified port: redis-server --port 8888
    3. Configuration file startup:
      • The configuration file in redis is redis.conf
      • Command to start the configuration file:./src/redis-server redis-01.conf
  5. Command to keep the redis service open: redis-server --service-install redis.windows-service.conf --loglevel verbose

Guess you like

Origin blog.csdn.net/weixin_52154534/article/details/134874210