1.memcashed依赖libevent
查看是否安装
brew info libevent
libevent: stable 2.1.12 (bottled)
Asynchronous event library
https://libevent.org/
/opt/homebrew/Cellar/libevent/2.1.12 (57 files, 2.2MB) *
Poured from bottle on 2021-07-07 at 15:45:21
From: https://mirrors.ustc.edu.cn/homebrew-core.git/Formula/libevent.rb
License: BSD-3-Clause
==> Dependencies
Build: autoconf ✘, automake ✘, libtool ✔, pkg-config ✔
Required: openssl@1.1 ✔
==> Analytics
install: 157,326 (30 days), 481,368 (90 days), 1,925,228 (365 days)
install-on-request: 1,512 (30 days), 4,606 (90 days), 61,922 (365 days)
build-error: 11 (30 days)
安装命令
brew install libevent
Warning: libevent 2.1.12 is already installed and up-to-date.
To reinstall 2.1.12, run:
brew reinstall libevent
2.安装memcache
brew install memcached
Warning: memcached 1.6.9 is already installed and up-to-date.
To reinstall 1.6.9, run:
brew reinstall memcached
3.启动
brew services start memcached
==> Successfully started `memcached` (label: homebrew.mxcl.memcached)
4.查看是否已经成功启动
ps -ef|grep memcached
501 42050 1 0 2:24下午 ?? 0:00.03 /opt/homebrew/opt/memcached/bin/memcached -l localhost
501 45221 37617 0 2:27下午 ttys002 0:00.01 grep memcached
5.测试连接
brew install telnet
telnet localhost 11211
Trying ::1...
Connected to localhost.
Escape character is '^]'.
最后建议用redis比memcache好用的多
参考
http://t.zoukankan.com/vitasyuan-p-9462726.html