首页 > 解决方案 > redis cygwin 在本地 pc 上运行,与 redis-cli 连接会给出无法在 127.0.0.1:6668 连接到 Redis:名称或服务未知

问题描述

得到:

Could not connect to Redis at 127.0.0.1:6668: Name or service not known
Aborted (core dumped)

错误出现在:/dev/redis-5.0.7/deps/hiredis/net.c 第 333 行

if ((rv = getaddrinfo(c->tcp.host, _port,  & hints,  & servinfo)) != 0) {

     hints.ai_family = AF_INET6;

     if ((rv = getaddrinfo(addr, _port,  & hints,  & servinfo)) != 0) {
         __redisSetError(c, REDIS_ERR_OTHER, gai_strerror(rv));  
        return REDIS_ERR;  
     }

 }

当我打印提示时,我得到:

(gdb) print hints
$18 = {ai_flags = 0, ai_family = 23, ai_socktype = 1, ai_protocol = 0, ai_addrlen = 0, ai_canonname = 0x0, ai_addr = 0x0, ai_next = 0x0}

当我打印 rv 我得到:

(gdb) print rv
$16 = 8

我使用的是 Windows 10 64 位

是某种问题还是ip6问题?

更新我找到了答案并使用 cygwin https://github.com/meiry/redis5_compiled_for_windows10 编译它

标签: crediswindowcygwin

解决方案


推荐阅读