c - 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
编译它
解决方案
推荐阅读
- python - 恢复 tensorflow 模型并将其用于预测
- javascript - 更新按钮状态 onClick React
- javascript - 如何判断是否支持 JavaScript 运算符?
- angular - Angular Material Select 设置默认的第一个选项
- lisp - Common Lisp:在 first、rest、last 中解构列表(如 Python 可迭代解包)
- python - Python - 使用 lambda 过滤元组列表
- .htaccess - 如何使用 htacccess 重定向和传递 URL 参数?
- python - 如何在 Python 中使用 for 循环从每个类别中选择数据子集?
- c++ - 为 char[] 实现的 fstream getline(*char, string)
- javascript - 为什么在管道请求时我需要 writeHead?