Mac安装Redis

MAC下安装Redis

使用wegt安装

From source code
Download, extract and compile Redis with:
5.0版本链接http://download.redis.io/releases/redis-5.0.0.tar.gz
如果下载失败可能需要加sudo权限

$ wget https://download.redis.io/releases/redis-6.2.6.tar.gz
$ tar xzf redis-6.2.6.tar.gz
$ cd redis-6.2.6
$ make

The binaries that are now compiled are available in the src directory. Run Redis with:

$ src/redis-server

You can interact with Redis using the built-in client:

$ src/redis-cli
redis> set foo bar
OK
redis> get foo
"bar"

手动安装

官网下载安装包: http://redis.io/download

解压: 将下载的redis.tar.gz解压到/usr/local(你要安装的)目录(命令tar -zvxf redis.tar.gz)

编译测试: 终端进入redis目录,输入命令sudo make test

编译安装:sudo make install

启动Redis:redis-server


**可能遇到的问题:**
cat@CatdeMacBook-Pro redis-6.2.6 % sudo make test
sudo: /etc/sudoers is world writable
sudo: no valid sudoers sources found, quitting
sudo: error initializing audit plugin sudoers_audit

解决方案:

打开访达进入/etc/sudoers目录

找到sudoers右键-显示简介

找到共享与权限-点击右下角小锁头-将系统权限修改为读与写-将wheel和everyone权限修改为只读

你可能感兴趣的:(数据库原理,redis,macos,数据库)