1. Download redis on the official website and download the latest stable version:
2. Unzip to / usr / local directory:
解压:tar zxvf redis-5.0.7.tar.gz
移动到: mv redis-5.0.7 /usr/local/
//版本和名称对应
3. Switch to the redis directory:
切换目录: cd /usr/local/redis-5.0.7/
4. Compile and install
编译测试 sudo make test
编译安装 sudo make install
5. Encountered problems:
5.1 sh: ./mkreleasehdr.sh: Permission denied
sh-3.2# sudo make test
cd src && /Library/Developer/CommandLineTools/usr/bin/make test
sh: ./mkreleasehdr.sh: Permission denied
CC release.o
release.c:36:10: fatal error: 'release.h' file not found
#include "release.h"
^~~~~~~~~~~
1 error generated.
make[1]: *** [release.o] Error 1
make: *** [test] Error 2
sh-3.2# sudo make install
cd src && /Library/Developer/CommandLineTools/usr/bin/make install
sh: ./mkreleasehdr.sh: Permission denied
CC release.o
release.c:36:10: fatal error: 'release.h' file not found
#include "release.h"
^~~~~~~~~~~
1 error generated.
make[1]: *** [release.o] Error 1
make: *** [install] Error 2
Solution:
//切换到redis的src目录下修改权限
sh-3.2# cd src/
sh-3.2# chmod +x mkreleasehdr.sh
5.2 "src / redis-benchmark" problem
Executing test client: couldn't execute "src/redis-benchmark": no such file or directory.
Solution:
//redis 目录下
sudo make distclean
sudo make
5.3 missing xcrun at:/Library/Developer/CommandLineTools/usr/bin/xcrun” 问题
“invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at:/Library/Developer/CommandLineTools/usr/bin/xcrun”
Solution:
//重新开一个命令行
xcode-select --install
6. Start redis after installation
7. Install Mac version of Redis visualization tool-Redis-Desktop-Manager
Download link: https://blog.csdn.net/qq_34156628/article/details/94736663
8. Use the visual tool-> connect to redis server-> input parameter connection in the lower left corner
9. Click refresh to see that the connection has been successful:
10. Redis common commands and configuration
https://www.cnblogs.com/jing99/p/10842147.html