方式一、
sudo brew install memcached
方式二、
1.安装libevent
cd /tmp
$ wget https://github.com/downloads/libevent/libevent/libevent-2.0.18-stable.tar.gz
$ tar zxvf libevent-2.0.18-stable.tar.gz
$ cd libevent-2.0.18-stable
$ ./configure
$ make
$ sudo make install
2.安装memcached
$ cd /tmp
$ wget http://memcached.googlecode.com/files/memcached-1.4.13.tar.gz
$ cd memcached-1.4.13
$ ./configure
$ make
$ sudo make install
3.使用memcached
指定端口启动
memcached -p 8000
后台启动
memcached -d -p 8000