如题

安装

以管理员身份运行。

1
2
3
C:\Windows\system32>cd C:\dev\dev.services\memcached
C:\dev\dev.services\memcached>memcached.exe -d install
C:\dev\dev.services\memcached>memcached.exe -d start

reference

卸载

  • 以管理员身份运行 cmd
  • 进入 memcached.exe 所在目录:cd C:\dev\dev.services\memcached
  • 停止 memcached: memcached.exe -d stop
  • 卸载:memcached.exe -d uninstall

坑:windows 8, windows 10, memcached 通过 localhost 无法连接的问题。

1
2
3
4
Notice: Memcache::connect(): Server localhost (tcp 11211, udp 0) failed with: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. (10060) in ...
Warning: Memcache::connect(): Can't connect to localhost:11211, A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. (10060) in
#中文
Notice: Memcache::connect() [memcache.connect]: Server localhost (tcp 11211) failed with: 由于连接方在一段时间后没有正确答复或连接的主机没有反应,连接尝试失败。 (10060)

windows 8, windows 10 默认启动了ipv6的系统,被ipv6干扰了,把localhost解析到ipv6了

1
2
3
4
5
6
7
8
9
10
11
12
C:\Users\AndyChen>ping localhost

Pinging DESKTOP-LSMCK87 [::1] with 32 bytes of data:
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms

Ping statistics for ::1:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms

在 Windows 8/10 系统下,localhost 在系统内部会被解析成 ::1 (IPv6) 和 127.0.0.1(IPv4),其中 IPv6 这个地址优先级会更高一些。
如果想让Windows 8/10 系统使用 IPv4 的前置策略代替 IPv6,请设置注册表,
运行:regedit
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters\
在这里编辑或者新建 DisabledComponents (32位DWORD)键,编辑键值为 0x20 (十六进制)。

重启系统生效。